subject

Justin Kace is promoting the metric system and wants people to be able to convert miles to kilometers and kilometers to miles. You are to develop a program that asks the user for a number of miles and converts miles to kilometers (multiplying miles by 1.609), and then asks for a number of kilometers and converts kilometers to miles (multiplying kilometers by 0.6214). Using pseudocode, develop an algorithm to solve this problem. Save your algorithm in a file named metricConverter. txt in Notepad.
Programmer's Workshop
In the Programmer's Workshop, you study a business problem and develop an Algorithm for a solution as a programmer would approach it. For this problem, you use pseudocode as the programming tool. In future modules, you use other tools, including flowcharts and JavaScript. These problems help you put together what you've learned in the module, paying special attention to good programming style.
Problem: Sunshine Books is a bookstore that's open every morning from 8:00 am to 12:00 pm. The manager wants information about the number of customers in the store at different times. A clerk, whose station is near the door, counts customers by making a mark on a piece of paper each time a customer enters. The paper is divided into four segments, one for each hour, and the clerk notes the time before making each mark. When the store closes at noon, the clerk wants to enter the numbers in the program, which then displays the total number of customers for the day and the average number of customers per hour.
Your job, as the programmer, is to develop an algorithm by using pseudocode. If the manager likes your pseudocode proposal, you might be invited back to write the program in an actual computer language.
Discussion: Use the IPO method to get started:
What outputs are requested? Total Customers and average customers per hour
What inputs are available? Number of customers for each hour
What processing is required? Get input, add numbers for total, and divide by number of hours for average
The next step is deciding what variables and constants you need. You need a variable for each item you want to keep track of (that is, each input and output) and sometimes a temporary variable for calculations. You should use a constant when you know ahead of time how many of something you have. Choose your variables and constants, giving them the following names and data types:
Total Customers (numeric): totCust
Average customers per hour (numeric): avgCust
Count of customers each hour (numeric): count1, count2, count3, count
Number of hours (numeric constant): NUM_HOURS
1. Open a new file in Notepad and save it as customerstats. txt
2. Start by entering your four documentation items, substituting your name for the author name and today's date for the date last modified:
// Program Name: Customer Statistics
/Purpose: Compute total and average number of customers over 4 hours
// Author: Adrian Tillman
// Date Last Modified: 01-13-2018
3. Next declare your variables and constants. Labeling the sections with a comment is helpful. Notice that some comments are placed on a separate line from the declaration for better readability. The entire program after the documentation lines is placed between the keywords Start and Stop.
Start
//Variables and constants
Declare Numeric totust //total customers
Declare Numeric avgCust//average customers per hour
Declare Numeric count1, count2, count3, count4//count of customers each hour
Declare Constant NUM_HOURS = 4 // number of hours
4. Now you're ready to get the input, do the calculations and display the output. Don't forget to display a program heading and thank the user at the beginning of the program!
// Program Heading
Display "Sunshine Books Customer Statistics Program
//Get number of customer for each hour
Display "Enter the # of customers for the first hour."
Input count1
Display "Enter the # of customers for the second hour:
Input count2
Display "Enter the # of customers for the third hour."
Input count3
Display "Enter the # of customers for the fourth hour:
Input count4
// Compute total and average, and display results
totCust = count1 + count2 + count3 + count4
avgCust = totCust/NUM_HOURS
Display "Total number of customers: " + tot Cust
Display "Average customers per hour:" + avgCust
//Thank the user for using this program
Display "That you for using this program. Good-bye!"
stop

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
question
Computers and Technology, 22.06.2019 14:10
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
You know the right answer?
Justin Kace is promoting the metric system and wants people to be able to convert miles to kilometer...
Questions
Questions on the website: 13722363