Starting Out with C++
Starting Out with C++
8th Edition
ISBN: 9780133888201
Author: GADDIS
Publisher: PEARSON CUSTOM PUB.(CONSIGNMENT)
bartleby

Concept explainers

Question
Book Icon
Chapter 11, Problem 11PC
Program Plan Intro

Monthly Budget

Program Plan:

  • Include the required header files into the program.
  • Declare the constant variables “Housing”, “UTILITIES”, “EXP_HOUSEHOLD”, “FOOD”, “MEDICAL”, “INSURANCE”, “ENTERTAINMENT”, “CLOTHING”, and “MISCELLANEOUS” in the type of “double”.
  • Declare a structure named “MonthlyBudget”.
    • Declare the member variables “var_house”, “var_util”, “var_hoholdexp”, “var_trans”, “var_food”, “var_medi”, “var_ins”, “var_enter”, “var_clo”, and “var_miscell” for the structure.
  • Declare function prototypes “inp_MonthlyBudget()” and “printReport()”.
  • Define the “main()” function.
    • Declare a structure variable “s_budget” for the structure “MonthlyBudget”.
    • Make a call to the function “inp_MonthlyBudget()” and pass the structure variable “s_budget” as parameter to read monthly budget from the user.
    • Make a call to the function “printReport()” and pass the structure variable “s_budget” as parameter to print the budget report on the screen.
  • Define a function named “inp_MonthlyBudget()” to get values for housing, utilities, household, expenses, transportation, food, medical, insurance, entertainment, clothing and miscellaneous from the user by using the received structure variable “sv”.
  • Define a function named “printReport()” to display the contents of the structures.
    • Create a variable “ovun” to store the value of over/under calculation.
      • Display each structure variable with the calculation of expenses.
      • Check the condition for monthly budget is over or under and display the message corresponding on the screen.

Blurred answer
Students have asked these similar questions
Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…
Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…
A student has established the following monthly budget:Housing 500.00Utilities 150.00Household expenses 65.00Tran sporta tion 50.00Food 250.00Medical 30.00Insurance 100.00Entertainment 150.00Clothing 75.00Miscellaneous 50.00Write a modular program that declares a Monthl yBudget structure with membervariables to hold each of these expense categor ies. The program should create twoMonthl yBudget structure variab les. The first will hold the budget figures given above.The second will hold the user-enter amoun ts actually spent during the past month.Using Program 7-19 as a model, the program should create a screen form that displayseach category name and its budgeted amoun t, then positions the cursor next to it forthe user to enter the amount actually spent in that category. Once the user data has allbeen entered, the program should compute and display the amoun t over or underbudget the student's expend itur es were in each category, as well as the amount over orunder budget for the…

Chapter 11 Solutions

Starting Out with C++

Ch. 11.10 - Prob. 11.11CPCh. 11.10 - Write a function that uses a Rectangle structure...Ch. 11.10 - Prob. 11.13CPCh. 11.10 - Prob. 11.14CPCh. 11.10 - Prob. 11.15CPCh. 11.11 - Prob. 11.16CPCh. 11.11 - Prob. 11.17CPCh. 11.11 - Prob. 11.18CPCh. 11.11 - Prob. 11.19CPCh. 11.11 - Prob. 11.20CPCh. 11.12 - Look at the following declaration: enum Flower {...Ch. 11.12 - What will the following code display? enum {...Ch. 11.12 - Prob. 11.23CPCh. 11.12 - What will the following code display? enum Letters...Ch. 11.12 - Prob. 11.25CPCh. 11.12 - Prob. 11.26CPCh. 11 - Prob. 1RQECh. 11 - Prob. 2RQECh. 11 - Prob. 3RQECh. 11 - Look at the following structure declaration:...Ch. 11 - Look at the following structure declaration:...Ch. 11 - Look at the following code: struct PartData {...Ch. 11 - Look at the following code: struct Town { string...Ch. 11 - Look at the following code: structure Rectangle {...Ch. 11 - Prob. 9RQECh. 11 - Prob. 10RQECh. 11 - Prob. 11RQECh. 11 - Look at the following declaration: enum Person {...Ch. 11 - Prob. 13RQECh. 11 - The ______ is the name of the structure type.Ch. 11 - The variables declared inside a structure...Ch. 11 - A(n) ________ is required after the closing brace...Ch. 11 - In the definition of a structure variable, the...Ch. 11 - Prob. 18RQECh. 11 - Prob. 19RQECh. 11 - Prob. 20RQECh. 11 - Prob. 21RQECh. 11 - Prob. 22RQECh. 11 - Declare a structure named TempScale, with the...Ch. 11 - Write statements that will store the following...Ch. 11 - Write a function called showReading. It should...Ch. 11 - Write a function called findReading. It should use...Ch. 11 - Write a function called getReading, which returns...Ch. 11 - Prob. 28RQECh. 11 - Prob. 29RQECh. 11 - Prob. 30RQECh. 11 - Prob. 31RQECh. 11 - Prob. 32RQECh. 11 - Prob. 33RQECh. 11 - Look at the following statement: enum Color { RED,...Ch. 11 - A per store sells dogs, cats, birds, and hamsters....Ch. 11 - T F A semicolon is required after the closing...Ch. 11 - T F A structure declaration does not define a...Ch. 11 - T F The contents of a structure variable can be...Ch. 11 - T F Structure variables may not be initialized.Ch. 11 - Prob. 40RQECh. 11 - Prob. 41RQECh. 11 - T F The following expression refers to element 5...Ch. 11 - T F An array of structures may be initialized.Ch. 11 - Prob. 44RQECh. 11 - T F A structure member variable may be passed to a...Ch. 11 - T F An entire structure may not be passed to a...Ch. 11 - T F A function may return a structure.Ch. 11 - T F when a function returns a structure, it is...Ch. 11 - T F The indirection operator has higher precedence...Ch. 11 - Prob. 50RQECh. 11 - Prob. 51RQECh. 11 - Prob. 52RQECh. 11 - Prob. 53RQECh. 11 - Prob. 54RQECh. 11 - Prob. 55RQECh. 11 - Prob. 56RQECh. 11 - Find the Errors Each of the following...Ch. 11 - Prob. 58RQECh. 11 - struct TwoVals { int a, b; }; int main () {...Ch. 11 - #include iostream using namespace std; struct...Ch. 11 - #include iostream #include string using namespace...Ch. 11 - struct FourVals { int a, b, c, d; }; int main () {...Ch. 11 - Prob. 63RQECh. 11 - Prob. 64RQECh. 11 - Prob. 65RQECh. 11 - struct ThreeVals { int a, b, c; }; int main () {...Ch. 11 - Prob. 67RQECh. 11 - Prob. 1PCCh. 11 - Movie Profit Modify the program written for...Ch. 11 - Prob. 3PCCh. 11 - Weather Statistics Write a program that uses a...Ch. 11 - Weather Statistics Modification Modify the program...Ch. 11 - Soccer Scores Write a program that stores the...Ch. 11 - Customer Accounts Write a program that uses a...Ch. 11 - Search Function for Customer Accounts Program Add...Ch. 11 - Speakers Bureau Write a program that keeps track...Ch. 11 - Prob. 10PCCh. 11 - Prob. 11PCCh. 11 - Course Grade Write a program that uses a structure...Ch. 11 - Drink Machine Simulator Write a program that...Ch. 11 - Inventory Bins Write a program that simulates...Ch. 11 - Prob. 15PC
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT