1. 2. Write a pseudocode algorithm for a program that asks the user for the number...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. 2. Write a pseudocode algorithm for a program that asks the user for the number gallons of gas used and the number of miles driven on a trip. Then the program should compute the miles per gallon for the trip and print that value with an appropriate label. Come up with 3 test cases for this algorithm and note those values in the table below. Use integer values for the inputs but include the fractional parts in the miles per gallon. Gallons of gas used Miles Traveled Note: You will implement this algorithm in lab. Based on the information on this webpage: Miles per Gallon Get a string that matches the original string except that it is all lowercase: Get a string that contained a specific portion of the original string: Get a string that matches the original string with all spaces at the beginning and end removed: Get a string that matches the original string except that all of the 'm's have been replaced with *M's: 1. 2. Write a pseudocode algorithm for a program that asks the user for the number gallons of gas used and the number of miles driven on a trip. Then the program should compute the miles per gallon for the trip and print that value with an appropriate label. Come up with 3 test cases for this algorithm and note those values in the table below. Use integer values for the inputs but include the fractional parts in the miles per gallon. Gallons of gas used Miles Traveled Note: You will implement this algorithm in lab. Based on the information on this webpage: Miles per Gallon Get a string that matches the original string except that it is all lowercase: Get a string that contained a specific portion of the original string: Get a string that matches the original string with all spaces at the beginning and end removed: Get a string that matches the original string except that all of the 'm's have been replaced with *M's:
Expert Answer:
Answer rating: 100% (QA)
Here is a pseudocode algorithm for the program you described 1 Display a message to prompt the user ... View the full answer
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date:
Students also viewed these programming questions
-
A stone is projected over horizontal ground from a point O on the ground. The velocity of projection is 30 ms at 40 to the horizontal. The effects of air resistance should be neglected. (a) State the...
-
Conversational yet professional tone 1. Your vacation request was approved. 2 . Please adhere to the signs and wash your hands thoroughly! 3. All employees are herewith instructed to return the...
-
Explain how family decision making may differ from the individual decision making process. What types of conflicts have you seen during the family decision making process, and what strategies have...
-
Data Set 14 in Appendix B lists highway fuel consumption amounts (mi/gal) for cars categorized by size (small, midsize, large). If we use those highway fuel consumption amounts arranged into the...
-
The cylindrical tank in Fig P2.47 is being filled with 20oC water by a pump developing an exit pressure of 175 kPa. At the instant shown, the air pressure is 110 kPa and H = 35 cm. The pump stops...
-
Holt Industries received a $2,000 prepayment from the Ramirez Company for the sale of new office furniture. Holt will bill Ramirez an additional $3,000 upon delivery of the furniture to Ramirez. Upon...
-
Water flows steadily from a tank mounted on a cart as shown in Fig. P5.44. After the water jet leaves the nozzle of the tank, it falls and strikes a vane attached to another cart. The cart's wheels...
-
Titan Distribution, Inc., employed Quintak, Inc., to run its tire mounting and distribution operation in Des Moines, Iowa. Robert Chalfant worked for Quintak as a second-shift supervisor at Titan. He...
-
A beam of light with a frequency of 4 x 10 4 Hz is used for a double-slit experiment in water. The index of refraction of water is 1.3. The 1st bright fringe next to the center peak is on the screen...
-
Suppose we have the following real estate speculation scenario for a 1 year investment: Purchase price of house: $150,000 Equity: $120,000 Debt: $30,000 @10% interest Interest Payments: $3,000 What...
-
How Microsoft will deal with cyber hacking and unethical use of patient sensitive data by acquiring Nuance?
-
This problem concerns Trivium. Assume that IV is a zero vector (all zeros) and key bits are all 1s. Find the first five output bits. Note that these are not used for encryption since the warm-up...
-
McLeod Motors Ltd. Identify each step in the BN-88-55 production process and identify where inventory exists in the system. What functions does it serve? What would be the cost of not having this...
-
You will write the Flight method assignGroup, which is described as follows. The parameter to the Flight method assignGroup is a list of passengers, group. These passengers require a block of...
-
uild a predictive maintenance system for industrial machinery using IoT sensors and machine learning. The system should predict potential equipment failures and schedule maintenance to minimize...
-
The firm has $0.500 billion in outstanding debt. Its total value is $2 billion. Its cost of debt (rd) is 8% and its cost of equity is (re) is 12%.What is its weighted average cost of capital (WACC)...
-
Given the rational function z-2 2-2-6' f(x)= let y = f(x) be its graph. Using complete sentences, write a short paragraph explaining how to find any/all x-intercepts and vertical asymptotes of the...
-
Reconsider Prob. 1474. In order to drain the tank faster, a pump is installed near the tank exit as in Fig. P1475. Determine how much pump power input is necessary to establish an average water...
-
A program can access the private members of a class _____________________. a. Directly b. Only through the public members of the class c. Only through other private members of the class d. None of...
-
What number will the following code display on the computer screen? int sum = 0; int y = 0; do { for (int x = 1; x
-
A program needs to write the contents of a string variable named capital and the newline character to the sequential access file associated with the outFile object. Write the code to accomplish this...
-
A crystal sample of bacteriorhodpsin, a light-sensitive protein found in halobacteria that responds to light energy, has crystal planes separated by 0.20 nm. If a beam of 11 keV x rays illuminates a...
-
A nickel crystals work function is measured to be 5.22 eV at 25C. As the temperature increases by 300C, the work function drops by 50 meV. By how much does this shift the threshold wavelength for...
-
Investigators have created structures consisting of linear chains of ionized atoms on a smooth surface. Electrons are restricted to travel along the chain. The energy levels of the electrons match...
Study smarter with the SolutionInn App