Problem Solving with C++ (9th Edition)
Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
Question
Book Icon
Chapter 7, Problem 12PP
Program Plan Intro

Program Plan:

  • Include the appropriate headers into program.
  • Declare the constant variables and functions.
  • Declare the function prototypes.
  • Define the “main()” function.
    • Declare the variable “production[]” in type of integer.
    • Print the value.
    • Call the functions with appropriate arguments.
    • Return statement.
  • Define the function “graph()” with its arguments.
    • Declare the appropriate variables.
    • Declare the array variable in type of “char”.
    • Using “for” loop, assign “*” and “ ” to array.
    • Using “for” loops, print the values on screen.
  • Define the function “scale()” with its arguments.
    • Using “for” loop, call the “roundNum()” function to save value to array.
  • Define the function “getTotal()” with its arguments.
    • Prompt the value from user.
    • Using “for” loop, add the values and store into “total” variable.
  • Define the function “inputData()” with its arguments.
    • Using “for” loop, get the “plantNumber” from user.
    • Call the “getTotal()” function with arguments.
  • Define the function “roundNum()” with its arguments.
    • Return the rounded value.

Blurred answer
Students have asked these similar questions
2. Write a Java program that would resemble a payroll system. An input window which will accept the employee number and the number of days of rendered work. A 2d-arraylist that contains the employee number and the rate per day is to be searched and used to compute for the gross salary. Gross salary is computed by multiplying the number of days of rendered work by rate per day of the particular employee. If the gross salary computed is greater than 100,000 the tax is 20% of the gross salary, otherwise, the tax is 10%. Deduct the tax from the gross salary to get the net pay. Display the employee number, gross salary, tax deduction, and the net pay in an output window. Design your own input/output windows.
The purpose is to write a program with 2D arrays that will display Knight's Tour. Knight's Tour is a fascinating problem that is done on an electronic chessboard with a knight. Starting at any location on the chessboard, a knight proceeds to move on the board in such a manner that all positions on the chessboard are visited, once and once only. The knight may only move according to the rules of chess playing.  The matrixes below show a sequence of knight moves that starts from the top-left corner.  In most cases, the knight is locked in place and can go no farther. Note: there are only 3 legal knight moves from the 44 locations and they have already been visited. 01 60 39 34 31 18 09 6438 35 32 61 10 63 30 1759 02 37 40 33 28 19 0836 49 42 27 62 11 16 2943 58 03 50 41 24 07 2048 51 46 55 26 21 12 1557 44 53 04 23 14 25 0652 47 56 45 54 05 22 13   01 22 39 20 03 18 09 1600 37 02 23 08 15 04 1335 40 21 38 19 12 17 1000 00 36 41 24 07 14 0500 34 00 32 00 28 11 2600 00 00 00 42 25 06 2900…
The purpose is to write a program with 2D arrays that will display Knight's Tour. Knight's Tour is a fascinating problem that is done on an electronic chessboard with a knight. Starting at any location on the chessboard, a knight proceeds to move on the board in such a manner that all positions on the chessboard are visited, once and once only. The knight may only move according to the rules of chess playing.  The matrixes below show a sequence of knight moves that starts from the top-left corner.  In most cases, the knight is locked in place and can go no farther. Note: there are only 3 legal knight moves from the 44 locations and they have already been visited. 01 60 39 34 31 18 09 6438 35 32 61 10 63 30 1759 02 37 40 33 28 19 0836 49 42 27 62 11 16 2943 58 03 50 41 24 07 2048 51 46 55 26 21 12 1557 44 53 04 23 14 25 0652 47 56 45 54 05 22 13   01 22 39 20 03 18 09 1600 37 02 23 08 15 04 1335 40 21 38 19 12 17 1000 00 36 41 24 07 14 0500 34 00 32 00 28 11 2600 00 00 00 42 25 06 2900…

Chapter 7 Solutions

Problem Solving with C++ (9th Edition)

Ch. 7.2 - Consider the following function definition: void...Ch. 7.2 - Prob. 12STECh. 7.2 - Write a function definition for a function called...Ch. 7.2 - Consider the following function definition: void...Ch. 7.2 - Insert const before any of the following array...Ch. 7.2 - Write a function named outOfOrder that takes as...Ch. 7.3 - Write a program that will read up to ten...Ch. 7.3 - Write a program that will read up to ten letters...Ch. 7.3 - Following is the declaration for an alternative...Ch. 7.4 - Prob. 20STECh. 7.4 - Write code that will fill the array a (declared...Ch. 7.4 - Prob. 22STECh. 7 - Write a function named firstLast2 that takes as...Ch. 7 - Write a function named countNum2s that takes as...Ch. 7 - Write a function named swapFrontBack that takes as...Ch. 7 - The following code creates a small phone book. An...Ch. 7 - There are three versions of this project. Version...Ch. 7 - Hexadecimal numerals are integers written in base...Ch. 7 - Solution to Programming Project 7.3 Write a...Ch. 7 - Prob. 4PPCh. 7 - Write a program that reads in a list of integers...Ch. 7 - Prob. 6PPCh. 7 - An array can be used to store large integers one...Ch. 7 - Write a program that will read a line of text and...Ch. 7 - Write a program to score five-card poker hands...Ch. 7 - Write a program that will allow two users to play...Ch. 7 - Write a program to assign passengers seats in an...Ch. 7 - Prob. 12PPCh. 7 - The mathematician John Horton Conway invented the...Ch. 7 - Redo (or do for the first time) Programming...Ch. 7 - Redo (or do for the first time) Programming...Ch. 7 - A common memory matching game played by young...Ch. 7 - Your swim school has two swimming instructors,...Ch. 7 - Your swim school has two swimming instructors,...Ch. 7 - Prob. 19PPCh. 7 - The Social Security Administration maintains an...
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education