+1 (208) 254-6996 [email protected]
  

Exp19_Access_Ch06_Cap – Insurance 1.0

Project Description:

You have been asked to modify a database that tracks driver data and insurance details. You will update, add to, and delete records from tables. You will also create queries that aggregate data, find unmatched, and find duplicate values.

Start Access. Open the downloaded   Access file named Exp19_Access_Ch6_Cap_Insurance. Grader has automatically added   your last name to the beginning of the filename. Save the file to the   location where you are storing your files.

Don't use plagiarized sources. Get Your Custom Essay on
Exp19_Access_Ch06_Cap – Insurance 1.0
Just from $13/Page
Order Essay

Open the Drivers table, observe   the data, and then close the table. Create an update query based on the Drivers   table. Include all of the fields from the table.

Set   the criteria to update Special   drivers to Senior.   Run the query, save it as Update Class,   and then close the query.

Create   a make table query based on the Drivers table. Include all of the fields from   the table. Set the criteria to select Senior   drivers. The query should make a new table named Non-Standard   Drivers   in the current database.

Grader – Instructions Access 2019 Project

Exp19_Access_Ch06_Cap – Insurance 1.0

Project Description:

You have been asked to modify a database that tracks driver data and insurance details. You will update, add to, and delete records from tables. You will also create queries that aggregate data, find unmatched, and find duplicate values.

Steps to Perform:

StepInstructionsPoints Possible
1Start Access. Open the downloaded Access file named Exp19_Access_Ch6_Cap_Insurance. Grader has automatically added your last name to the beginning of the filename. Save the file to the location where you are storing your files.0
2Open the Drivers table, observe the data, and then close the table. Create an update query based on the Drivers table. Include all of the fields from the table.8
3Set the criteria to update Special drivers to Senior. Run the query, save it as Update Class, and then close the query.6
4Create a make table query based on the Drivers table. Include all of the fields from the table. Set the criteria to select Senior drivers. The query should make a new table named Non-Standard Drivers in the current database.10
5Run the query, save it as Make Non-Standard Drivers and then close the query.4
6Make a copy of the Make Non-Standard Drivers query and save it as Append Non-Standard Drivers.4
7Change the query type to Append and append records to Non-Standard Drivers. Set the criteria to select Minor drivers. Run, save, and then close the query.6
8Set DriverID as the primary key field of the Non-Standard Drivers table. Save and close the table.4
9Make a copy of the Append Non-Standard Drivers query and save it as Delete Non-Standard Drivers.4
10Change the query type to Delete. Set the criteria to select Minor or Senior drivers. Run, save, and then close the query.6
11Create a crosstab query based on the Non-Standard Drivers table. Set Class as the row heading field and Gender as the column heading field. Summarize the data by counting the DriverIDs. Save the query using the default name, and view the query results.8
12Modify the query so that Class displays as the column heading and Gender displays as the row heading. Save the query as Non-Standard Drivers_Crosstab and run the query.6
13Modify the database (Non-Standard Drivers table) so that the gender M displays as Male and F displays as Female. Run the crosstab query again to display the changes. Close the query.6
14Create a find duplicates query based on the Drivers table where there is a repeated LastName and Street value. Add the DriverID and FirstName fields to the query results. Save the query using the default name, and view the query results. Note that Eric and Kirk Abelson live at the same address, but have two different DriverIDs. In the Drivers table, expand the Subdatasheet for Eric and notice that he carries insurance for both household vehicles. Close the table and the query.11
15Create an unmatched query to find drivers in the Drivers table who have no insurance listed in the Insurance table. Include all fields from the Drivers table. Save the query using the default name, and view the query results.11
16For the driver named Lawrence Alexander, add a record to the Insurance table. Enter the InsuranceID number as 10010, the DriverID as 341890123, and the Agent as AS8842. Populate the remaining fields (AutoType, AutoYear, TagID, and TagExpiration) with data of your choice. Close the table. Run the Drivers Without Matching Insurance query again. Note that Lawrence Alexander no longer appears in the results, as you have used the query to identify missing data and corrected the error. Kirk Abelson is covered under the same policy as Eric, his father. Close the query.6
17Close all database objects. Close the database and then exit Access. Submit the database as directed.0
Total Points100

Created On: 07/11/2019 1 Exp19_Access_Ch06_Cap – Insurance 1.0

Professor Michael G. Solomon

BLCN 631 – Blockchain Implementation

EFD Chapter 8(b) – Learning About Solidity

Syntax – Solidity’s Grammar

This isn’t a development course

• Awareness of smart contract source code • Understanding of deployment process • Ability to interact with smart contract

functions

However, implementations require

• High-level • Just the facts

Language coverage

Basic Smart

Contract Syntax

Pragma

• Specifies which compiler versions should work

• Keeps compiler upgrades from breaking code

Comments

• Used to document code

Import

• External files your smart contract can use

Contract(s)

• Body of smart contract code

Example

pragma solidity ^0.5.0; // This is a single line comment

import library.sol; // Imports a library of functions we can use

contract HelloWorld {

string private helloMessage = “Hello world”;

function getHelloMessage() public view returns (string memory) {

return helloMessage;

}

}

Storing Data in Solidity

Location Description

Stack Small local variables

Memory Local variables (default) and function arguments

Storage State variables and structs (by default)

Data Types

• uInt

• int

• byte

• string

• bool

• address

• mapping

• enum

Data Types Example pragma solidity ^0.5.0;

contract DataTypes {

uint x = 9;

int i = -68;

uint8 j = 17;

bool isEthereumCool = true;

address owner = msg.sender; // msg.sender is the Ethereum address of the account that sent this transaction

bytes32 bMsg = “hello”;

string sMsg = “hello”;

function getStateVariables() public view returns (uint, int, uint, bool, address, bytes32, string memory) {

return (x, i, j, isEthereumCool, owner, bMsg, sMsg);

}

}

Deploy New Contract

• Add DataTypes.sol contract to migrations var HelloWorld = artifacts.require(“HelloWorld”);

var DataTypes = artifacts.require(“DataTypes”); // Add this line

module.exports = function(deployer) {

deployer.deploy(HelloWorld);

deployer.deploy(DataTypes); // Add this line

};

• Deploy contracts (all) truffle deploy –reset (in Truffle console)

• Invoke function (to display state variables) DataTypes.deployed().then(function(instance) {return instance.getStateVariables() });

Computation and Gas

All EVMs run all smart contract code

Denial of Service (DoS) attack

Could disable all nodes

Gas avoids DoS attacks and infinite loops

Every transaction costs some gas

More work = more gas

Incentive to keep things simple

Ethereum Gas Charges Component Comments

Gas price

Highest price per gas unit a transaction originator is willing to pay. Miners use this limit to determine if the transaction is worth including in a block. If the value is too low, the transaction may not be profitable. If too many transactions are selected with very high gas prices. It may take too long to mine the block and the miner might lose to another node.

Gas limit

Total number of gas units the transaction originator is willing to pay. It must be high enough to allow all operations to complete. If this value is too low, the EVM will terminate the transaction and undo all of its operations. Also, each block has a gas limit, so miners can’t just pick the transactions with very high gas limits – they have to choose transactions with gas limits that are cumulatively lower than the block gas limit.

Gas cost Cost of a single operation. For example, the ADD operation costs 3 gas and the MUL operation costs 5 gas.

Transaction fee Total fee for computations in a transaction. The formula is: transaction fee = total gas cost * gas price.

Unused gas If the gas limit for a transaction is greater than the actual gas cost, the unused gas is returned to the transaction originator. You only have to pay for the gas you use.

Visibility Modes Visibility What it means for functions What is means for variables

public Anyone can call this function. Anyone can access this variable’s value.

external Only external functions can call this function.

This doesn’t apply to state variables, and only external functions can access this local variable’s value.

internal Only functions in this contract and any contract deriving from it can call this function.

Only functions in this contract and any contract deriving from it can access this variable’s value.

private Only function sin this contract can call this function. Only functions in this contract can access this variable’s value.

Execution Flow Statement What it does Example

if-else Executes a group of statements if a condition is true, and optionally executes another set of statements if the condition is false (else).

numDonuts = purchasedQty; if (numDonuts >= 12)

giveDozenPrice = true; else

giveDozenPrice = false;

while Executes a group of statements zero or more times until some condition is true (pre-test repetition structure.)

numDonuts = 1; giveDozenPrice = false; While (numDonuts < purchasedQty) {

numDonuts++; if (numDonuts >= 12)

giveDozenPrice = false; break;

}

Execution Flow Statement What it does Example

do-while

Executes a group of statements one or more times until some condition is true (post-test repetition structure.) Note that a do-while loop always executes at least once.

numDonuts = 1;

giveDozenPrice = false;

do {

numDonuts++;

if (numDonuts >= 12)

giveDozenPrice = false;

break;

} (while numDonuts < purchasedQty);

for

Executes a group of statements zero or more times until some condition is true (pre-test repetition structure.) This differs from a while loop in that the test condition is modification is defined in the statement.

giveDozenPrice = false;

for (numDonuts=1; numDonuts<=purchasedDonuts; numDonuts++) {

if (numDonuts >= 12)

giveDozenPrice = true;

break;

}

Errors and Exceptions Function What it does Example

revert()

Undoes all state changes, allows a return value, and refunds remaining gas to the caller. You should use this function to catch expected conditions that indicate that a transaction should be terminated.

if (msg.sender != owner( { revert(); }

assert()

Undoes all state changes and uses up all remaining gas (i.e. does not return unused gas – like the legacy throw() function). You should never encounter this function in properly functioning code.

assert(msg.sender == owner);

require()

Undoes all state changes, allows a return value, and refunds remaining gas to the caller. You should use this function to proactively execute code when pre-requisite conditions have not been met.

require(msg.sender == owner);

Summary

HANDLING DATA IN SOLIDITY

CARRYING OUT COMPUTATIONS

IN SOLIDITY

CODING TO LIMIT GAS COST

CONTROLLING EXECUTION FLOW

RESPONDING TO ERRORS

Professor Michael G. Solomon

BLCN 631 – Blockchain Implementation

EFD Chapter 7 – Building Your First Ethereum Apps

Setting up Your Project

• Everything starts with a project

• We’ll use Truffle to manage projects

• Edit the config file first

• Use VS Code

• Use Ganache settings (next slide, please)

• HOSTNAME

• PORT NUMBER

Ganache – Host & Port

Exploring Ganache

Simple Smart

Contract

• New language – changes frequently

We’ll use the Solidity language

• Blockchain access costs $$ (crypto) • What gets written in a blockchain

• Stays in the blockchain

Remember

• Returns a string – “Hello world!”

First smart contract

HelloWorld.sol

pragma solidity ^0.5.0;

contract HelloWorld {

string private helloMessage = “Hello world”;

function getHelloMessage() public view returns (string memory) {

return helloMessage;

}

}

Writing Smart

Contract Code

• Create new file – contracts/HelloWorld.sol

• Create new file – migrations/2_contract_migrations.js

• Type the following code:

var HelloWorld =

artifacts.require(“HelloWorld”);

module.exports = function(deployer) {

deployer.deploy(HelloWorld);

};

Compiling Smart

Contracts

• EVM can’t run source code

• Smart contracts must be compiled into bytecode

• EVMs run bytecode

• Open new terminal (Terminal -> New Terminal)

• Type: truffle compile

Deploying a Smart Contract

• Make sure Ganache is running

• In VS Code terminal, type:

• truffle deploy –reset

• Go look at Ganache again

• Account[0] balance, blocks, transactions

Invoking a Smart

Contract Function

• Invoke smart contract functions

• At the VS code terminal prompt

• Three separate commands below:

truffle console

HelloWorld.deployed().then(function(in

stance) {return instance });

HelloWorld.deployed().then(function(in

stance) {return

instance.getHelloMessage() });

Summary

Exploring your development environment

Coding in Solidity

Writing smart contracts

Using blockchain data

Order your essay today and save 10% with the discount code ESSAYHELP