Chat with us, powered by LiveChat Bob runs a food truck business with four trucks. Every day, each truck leaves the warehouse and travels to a different part of town, selling food at multiple construction site - Essayabode

Bob runs a food truck business with four trucks. Every day, each truck leaves the warehouse and travels to a different part of town, selling food at multiple construction site

Problem Statement (paste this into the top of your submission)

Bob runs a food truck business with four trucks. Every day, each truck leaves the warehouse and travels to a different part of town, selling food at multiple construction sites. To better understand his business, he collects metrics every day for each truck. The metrics include 1) the number of sites visited, 2) the cost of gas for the day, and 3) the revenue. Each day in the morning, the first thing Bob wants to do is generate a consolidated report of the previous days’ metrics. Bob has hired you to develop a program that he can run on a computer, where he can enter those previous day’s metrics and be shown a consolidated output report.

To enter metrics into the program, Bob will first enter the date – one time only. After this he will start entering the data for each individual truck in this order; Truck ID, number of Sites visited, Gas Expense, and Revenue.  After each item of data has been entered, that data should immediately be shown to Bob on the computer screen to allow him to ensure the data is correct. After all the data for a given truck is entered, the program should display the profit for that truck, calculated as the Revenue minus the Gas Expense. After Bob has entered ALL the data for ALL the trucks, he should enter the value “End” as a Truck ID to let the program know that there will be no further entries.   

After Bob has entered “End”, the program should display a summary of the data. The summary must display the overall Total Number of Trucks, Total Gas Expense, Total Revenue, Total Profit, and the Average Profit for the trucks. Additionally, the report must display the Highest Profit out of all the trucks, and Truck ID which had that Highest Profit. In the event of more than one truck earning the Highest Profit, only the first Truck entered into the system should be reported.

humanLevelWalkThrough_24_1_2

Basic Human Level Walk Trhough
Inputs Outputs
reportDate truckID numSites gasExpense revenue reportDate truckID numSites gasExpense revenue profit totalTruckCount totalGasExpense totalRevenue totalProfit averageProfit highestProfit highestProfitTruck
25-Jan-24 25-Jan-24
A 7 135 2,031 A 7 135 2,031 1,896 1 135 2,031 1,896 1,896 0
B 17.00 192.00 5193 B 17 192 5,193 5,001 2 327 7,224 6,897 3,449 5,001 B
C 13 109 3941 C 13 109 3,941 3,832 3 436 11,165 10,729 3,576 0
D 10 187 4505 D 10 187 4,505 4,318 4 623 15,670 15,047 3,762 0
End End

programLevelWalkThrough_24_1_2

Annotated Program Level Walk Through
Event Instructions Inputs Working memory Outputs
reportDate truckID numSites gasExpense revenue profit totalTruckCount totalGasExpense totalRevenue totalProfit highestProfit highestProfitTruck reportDate truckID numSites gasExpense revenue profit totalTruckCount totalGasExpense totalRevenue totalProfit averageProfit highestProfit highestProfitTruck
Initialize variables initialize variables => 0 0 0 0 0 0 0
output resportDate output resportDate Spring 2024
input resportDate input resportDate Spring 2024
New truck
input truckID input truckID A
output truckID output truckID A
check for the kill flag if(truckID = (End),stop and report, continue) => A != End, therefore continue
input numSites input numSites 7
output numSites output numSites 7
input gasExpense input gasExpense 135
output gasExpense output gasExpense 135
input revenue input revenue 2,031
output revenue output revenue 2,031
calculate profit profit = revenue – gasExpense => 2,031 – 135 = 1,896 1,896
output profit output profit 1,896
update totalTruckCount totaltruckcount = totaltruckCount + 1 => totaltruckCount++ => 0 + 1 = 1 1
update totalGasExpense totalGasExpense = totalGasExpense + gasExpense = 0 + 135 = 135 135
update totalRevenue totalRevenue = totalRevenue + revenue => 0 + 2,031 = 2,031 2,031
update totalProfit totalProfit = totalProfit + profit => 0 + 1,896 = 1,896 1,896
check update the highProfit if(profit > highProfit, highProfit = profit, skip) => 1,896 > 0 => true, so highProfit = 1,896 1,896
check update the highProfitTruck if(profit > highProfit, highProfitTruckID = truckID, skip) => 1,896 > 0 => true, so highProfitTruckID = A A
New truck
input truckID input truckID B
output truckID output truckID B
check for the kill flag if(truckID = (End),stop and report, continue) => B!= End, therefore continue
input numSites input numSites
output numSites output numSites
input gasExpense input gasExpense
output gasExpense output gasExpense
input revenue input revenue
output revenue output revenue
calculate profit profit = revenue – gasExpense => 2,031 – 135 = 1,896
output profit output profit
update totalTruckCount totaltruckcount = totaltruckCount + 1 => totaltruckCount++ => 0 + 1 = 1
update totalGasExpense totalGasExpense = totalGasExpense + gasExpense = 0 + 135 = 135
update totalRevenue totalRevenue = totalRevenue + revenue => 0 + 2,031 = 2,031
update totalProfit totalProfit = totalProfit + profit => 0 + 1,896 = 1,896
check update the highProfit if(profit > highProfit, highProfit = profit, skip) => 1,896 > 0 => true, so highProfit = 1,896
check update the highProfitTruck if(profit > highProfit, highProfitTruckID = truckID, skip) => 1,896 > 0 => true, so highProfitTruckID = A
New truck
input truckID input truckID C
output truckID output truckID
check for the kill flag if(truckID = (End),stop and report, continue) => C != End, therefore continue
input numSites input numSites
output numSites output numSites
input gasExpense input gasExpense
output gasExpense output gasExpense
input revenue input revenue
output revenue output revenue
calculate profit profit = revenue – gasExpense => 2,031 – 135 = 1,896
output profit output profit
update totalTruckCount totaltruckcount = totaltruckCount + 1 => totaltruckCount++ => 0 + 1 = 1
update totalGasExpense totalGasExpense = totalGasExpense + gasExpense = 0 + 135 = 135
update totalRevenue totalRevenue = totalRevenue + revenue => 0 + 2,031 = 2,031
update totalProfit totalProfit = totalProfit + profit => 0 + 1,896 = 1,896
check update the highProfit if(profit > highProfit, highProfit = profit, skip) => 1,896 > 0 => true, so highProfit = 1,896
check update the highProfitTruck if(profit > highProfit, highProfitTruckID = truckID, skip) => 1,896 > 0 => true, so highProfitTruckID = A
New truck
input truckID input truckID D
output truckID output truckID
check for the kill flag if(truckID = (End),stop and report, continue) => C!= End, therefore continue
input numSites input numSites
output numSites output numSites
input gasExpense input gasExpense
output gasExpense output gasExpense
input revenue input revenue
output revenue output revenue
calculate profit profit = revenue – gasExpense => 2,031 – 135 = 1,896
output profit output profit
update totalTruckCount totaltruckcount = totaltruckCount + 1 => totaltruckCount++ => 0 + 1 = 1
update totalGasExpense totalGasExpense = totalGasExpense + gasExpense = 0 + 135 = 135
update totalRevenue totalRevenue = totalRevenue + revenue => 0 + 2,031 = 2,031
update totalProfit totalProfit = totalProfit + profit => 0 + 1,896 = 1,896
check update the highProfit if(profit > highProfit, highProfit = profit, skip) => 1,896 > 0 => true, so highProfit = 1,896
check update the highProfitTruck if(profit > highProfit, highProfitTruckID = truckID, skip) => 1,896 > 0 => true, so highProfitTruckID = A

Sheet2

spring 2024

Sheet1

23_1_002

image1.emf

,

W. Brian Lambert, PhD CIS 2110 – Structured Problem Solving [email protected] File Name: CIS 2110 HW2 Instructions 2024 Spring

Page 1 of 4

CIS 2110 Homework Assignment #2

Problem Statement, I/O Design and Walk-throughs

Learning Objectives: To demonstrate the student's level of competence in:

• The first two steps in problem solving • Walk-throughs

Assignment: Read chapter 2 of the Green Morrell textbook, then consider the following Problem:

Problem Statement (paste this into the top of your submission)

Bob runs a food truck business with four trucks. Every day, each truck leaves the warehouse and travels to a different part of town, selling food at multiple construction sites. To better understand his business, he collects metrics every day for each truck. The metrics include 1) the number of sites visited, 2) the cost of gas for the day, and 3) the revenue. Each day in the morning, the first thing Bob wants to do is generate a consolidated report of the previous days’ metrics. Bob has hired you to develop a program that he can run on a computer, where he can enter those previous day’s metrics and be shown a consolidated output report.

To enter metrics into the program, Bob will first enter the date – one time only. After this he will start entering the data for each individual truck in this order; Truck ID, number of Sites visited, Gas Expense, and Revenue. After each item of data has been entered, that data should immediately be shown to Bob on the computer screen to allow him to ensure the data is correct. After all the data for a given truck is entered, the program should display the profit for that truck, calculated as the Revenue minus the Gas Expense. After Bob has entered ALL the data for ALL the trucks, he should enter the value “End

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?