Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 3, Problem 19RQE
Write a cout statement that uses stream manipulators to display the contents of the variable divSales in a field of eight spaces, in fixed-point notation, with a decimal point and two decimal digits.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
in c++
Write a program to generate a random number between 1 - 100, and then display which quartile the number falls in.
First quartile is 1 - 25
Second quartile is 26 - 50
Third quartile is 51 - 75
Fourth quartile is 76 - 100
To generate a random number, follow these steps:
include necessary header files
#include <cstdlib> //for random functions
#include <ctime> //for time functions
set constants for the minimum and maximum values of the desired range
const int MIN_VALUE = 1; //minimum range value
const int MAX_VALUE = 100; //maximum range value
seed the random number generator (RNG) with a unique unsigned int value - system time!
unsigned seed = time(0); //system time in seconds since 1/1/1970
srand(seed); //seed the RNG
get a random number in the desired range
int num = (rand() % (MAX_VALUE - MIN_VALUE + 1)) + MIN_VALUE;
The program should:
contain header comments as shown in class
display a "hello" message (more descriptive than shown in sample)…
2. Write an application that will calculate the Cummulative Grade Point Average [CGPA] using
While Loop for 3 students.
You have to enter the GRADE POINT of 5 different subjects for a student.
You have to enter the CREDIT for each of the 5 subjects for a Student.
GRADE POINT can take any value as given [5,6,7,8,9,10]
CREDIT can take any value as given [2,3,4]
CREDIT POINT = GRADE POINT * CREDIT
CGPA = CREDIT POINT / Sum of the CREDIT values of all the 10 semesters.
Display all the 5 subjects GRADE POINT
Display all the 5 subjects CREDIT
Display the CREDIT POINT
Display the Total of all the CREDIT values
Display the CGPA
Do the above program for 3 students totally.
Save your Shell script as cgpa.sh
C++ programming language
Chapter 3 Solutions
Starting Out With C++: Early Objects (10th Edition)
Ch. 3.1 - Prob. 3.1CPCh. 3.1 - What is the symbol called?Ch. 3.1 - Where does cin read its input from?Ch. 3.1 - Prob. 3.4CPCh. 3.1 - Assume value is an integer variable. If the user...Ch. 3.1 - A program has the following variable definitions....Ch. 3.1 - The following program will run, but the user will...Ch. 3.1 - Complete the following main function so that it...Ch. 3.2 - In each of the following cases, tell which...Ch. 3.2 - Complete the following table by writing the value...
Ch. 3.2 - Prob. 3.11CPCh. 3.2 - Study the following program code and then complete...Ch. 3.2 - Complete the following program skeleton so that it...Ch. 3.3 - Assume the following variable definitions: int a =...Ch. 3.3 - What will the following program code display if a...Ch. 3.3 - What will the following program code display? int...Ch. 3.5 - Prob. 3.17CPCh. 3.5 - Complete the following program code segment so...Ch. 3.6 - Write a multiple assignment statement that assigns...Ch. 3.6 - Write statements using combined assignment...Ch. 3.6 - What will the following program segment display?...Ch. 3.7 - Write cout statements with stream manipulators...Ch. 3.7 - The following program segment converts an angle in...Ch. 3.8 - Will the following string literal fit in the space...Ch. 3.8 - If a program contains the definition string name;...Ch. 3.8 - Prob. 3.26CPCh. 3.10 - Use a mathematical library function with a cout...Ch. 3.10 - Assume the variables angle1 and angle2 hold angles...Ch. 3.10 - To find the cube root (the third root) of a...Ch. 3.10 - Write a statement that produces a random number...Ch. 3 - Prob. 1RQECh. 3 - Prob. 2RQECh. 3 - Prob. 3RQECh. 3 - Assume the following variables are defined: int...Ch. 3 - What header files must be included in the...Ch. 3 - Write C++ expressions for the following algebraic...Ch. 3 - Assume a program has the following variable...Ch. 3 - Prob. 11RQECh. 3 - Write a multiple assignment statement that can be...Ch. 3 - Write a pair of multiple assignment statements...Ch. 3 - Is the following code legal? Why or why not? const...Ch. 3 - Write a cout statement that uses stream...Ch. 3 - Write a cout statement that uses stream...Ch. 3 - What header file must be included A) to perform...Ch. 3 - Pet World offers a 15 percent discount to senior...Ch. 3 - A bowling alley is offering a prize to the bowler...Ch. 3 - A retail store grants its customers a maximum...Ch. 3 - Little Italy Pizza charges 14.95 for a 12-inch...Ch. 3 - A) (Assume the user enters George Washington.)...Ch. 3 - Each of the following program segments has some...Ch. 3 - A) const int number1, number2, product; cout ...Ch. 3 - Soft Skills Often programmers work in teams with...Ch. 3 - Miles per Gallon Write a program that calculates a...Ch. 3 - Stadium Seating There are three searing categories...Ch. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Test Average Write a program that asks for five...Ch. 3 - Average Rainfall Write a program that calculates...Ch. 3 - Male and Female Percentages Write a program that...Ch. 3 - Vacation Days Write a program that prompts the...Ch. 3 - How Many Widgets? The Yukon Widget Company...Ch. 3 - How many Calories? A bag of cookies holds 30...Ch. 3 - Ingredients Adjuster A cookie recipe calls for the...Ch. 3 - Celsius to Fahrenheit Write a program that...Ch. 3 - Monthly Sales Tax A retail company muse file a...Ch. 3 - Property Tax Madison County collects property...Ch. 3 - Senior Citizen Property Tax Madison County...Ch. 3 - Math Tutor Write a program that can be used as a...Ch. 3 - Interest Earned Assuming there are no deposits...Ch. 3 - Monthly Payments The monthly payment on a loan may...Ch. 3 - Pizza Slices Joe's Pizza Palace needs a program to...Ch. 3 - How Many Pizzas? Modify the program you wrote in...Ch. 3 - Angle Calculator Write a program that asks the...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
If the memory cell whose address is 5 contains the value 8, what is the difference between writing the value 5 ...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
What is the purpose of the Application classs abstract start method?
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
What is the difference between main memory and secondary storage?
Starting Out With Visual Basic (7th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Write a program to print the corresponding Celsius to Fahrenheit table.
C Programming Language
T F: If the CInt function cannot convert its argument, it causes a runtime error.
Starting Out With Visual Basic (8th Edition)
Knowledge Booster
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
- C++ programmingarrow_forwardUsing c++ Basic student grade encoding program instructions: 1. Create a simple program that would let the user input a student's basic info and grades on 3 subjects. 2. The program should accept the following fields: - Full Name (should accept spaces for first and last name) - Year and Section (accept spaces as well) - Grade on 1st Subject (should accept numbers w/ decimals) - Grade on 2nd Subject (should accept numbers w/ decimals) - Grade on 3rd Subject (should accept numbers w/ decimals) 3. The Expected Output should: - Show all inputted information (same as expected output). - Then compute the average score from all of the inputted grade by adding all the grades and dividing the sum by 3. Store the value on a variable named aveGrade, it should be displayed with 2 decimals only. - And display the grade result based from the following criteria/conditions attached using else if statement 4. Make sure to test averaging if correct and all criteria/condition is set correctly.arrow_forwardThe credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment. Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan. Each row of the table should contain the following items: The month number (beginning with 1) The current total balance owed The interest owed for that month The amount of principal owed for that month The payment for that month The balance remaining after payment The amount of interest for a month is equal to balance × rate / 12. The amount of principal for a month is equal to the monthly payment minus the interest owed.arrow_forward
- The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment. Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan. Each row of the table should contain the following items: The month number (beginning with 1) The current total balance owed The interest owed for that month The amount of principal owed for that month The payment for that month The balance remaining after payment The amount of interest for a month is equal to balance × rate / 12. The amount of principal for a month is equal to the monthly payment minus the interest owed. An example of the program input and output is shown below: Enter the puchase price: 200 Month Starting Balance Interest to Pay Principal to Pay Payment Ending Balance 1 180.00 1.80 7.20 9.00 172.80 2 172.80 1.73 7.27…arrow_forwardC++ languagearrow_forwardSOLVE IN C# Canada Government has announced 250 immigration visa lottery for third world countries. Total number of Application collected 10000, starting from application number 1 to 10000. You are required to write a program for Canadian government to select 250 visa for lottery visa, randomly from the pool of 10000 application and print the application number on screen Note: No input required in this programarrow_forward
- // MovieGuide.cpp - This program allows each theater patron to enter a value from 0 to 4 // indicating the number of stars that the patron awards to the Guide's featured movie of the // week. The program executes continuously until the theater manager enters a negative number to // quit. At the end of the program, the average star rating for the movie is displayed. #include <iostream> #include <string> using namespace std; int main() { // Declare and initialize variables. double numStars; // star rating. double averageStars; // average star rating. double totalStars = 0; // total of star ratings. int numPatrons = 0; // keep track of number of patrons // This is the work done in the housekeeping() function // Get input. cout << "Enter rating for featured movie: "; cin >> numStars; // This is the work done in the detailLoop() function // Write while loop here //…arrow_forward// MovieGuide.cpp - This program allows each theater patron to enter a value from 0 to 4 // indicating the number of stars that the patron awards to the Guide's featured movie of the // week. The program executes continuously until the theater manager enters a negative number to // quit. At the end of the program, the average star rating for the movie is displayed. #include <iostream> #include <string> using namespace std; int main() { // Declare and initialize variables. double numStars; // star rating. double averageStars; // average star rating. double totalStars = 0; // total of star ratings. int numPatrons = 0; // keep track of number of patrons // This is the work done in the housekeeping() function // Get input. cout << "Enter rating for featured movie: "; cin >> numStars; // This is the work done in the detailLoop() function // Write while loop here //…arrow_forwardC++ Programming Instructions Write a program that prompts the user for a sequence of characters (all typed on a single line) and counts the number of vowels ('a', 'e', 'i', 'o', 'u'), consonants, and any other characters that appear in the input. The user terminates input by typing either the period (.) or exclamation mark character (!) followed by the Enter key on your keyboard. Your program will not count white space characters.I.e., you will ignore white space characters.Though, the cin statement will skip white space characters in the input for you. Your program will not be case-sensitive. Thus, the characters 'a' and 'A' are both vowels and the characters 'b' and 'B' are both consonants. For example, the input How? 1, 2, 3. contains one vowel, two consonants, and six other kinds of characters. IMPORTANT: Your program must use the while statement only when looping. I.e., do not use a for statement or any other looping statement. Test 1 > run Enter text: . Your sentence has 0…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License