Programming and Problem Solving with C++: Comprehensive
6th Edition
ISBN: 9781284076592
Author: Dale, Nell
Publisher: JONES+BART
expand_more
expand_more
format_list_bulleted
Question
Chapter 3, Problem 1PSCS
Program Plan Intro
To modify the case study
Expert Solution & Answer
Explanation of Solution
Following is the modified program(changes are highlighted in grey):
/* Put code from book ......... ......... ......... */ //main function intmain() { /* Put code from book ......... ......... ......... */ //modifed code cout<<"For a loan amount of "<<LOAN_AMOUNT<<" with an interest of "<<YEARLY_INTEREST<<" and a "<<NUMBER_OF_YEARS<<fixed<<setprecision(2)<<" year mortgage."<<endl; cout<<fixed<<setprecision(2)<<" your monthly payment are $"<<payment<<"."<<endl; //exiting from program return 0; }
Explanation:
The setprecision(2) along with fixed is used to fix the precision value to two decimal point. Remove the setprecision(2) along with fixed from the first cout statement.Put the setprecision(2) along with fixed from the start of second cout statement.
Sample Output:
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Can anyone help me with this problem ? It is C programming
Thank you a lot
how can I write a statement in C++ that would print last name, followed by a comma, followed by first name. And do not print anything else (that includes blanks)?
Hi, I need help with the item below - thanks!
I am trying to learn to write in C programing using Visula Studio Code but I cannot figure out how to show the $ sign in the Terminal section as shown in the attached file. Can you help me please??
Chapter 3 Solutions
Programming and Problem Solving with C++: Comprehensive
Ch. 3 - Prob. 1PSCSCh. 3 - Prob. 1EPECh. 3 - Prob. 2EPECh. 3 - Prob. 3EPECh. 3 - Prob. 4EPECh. 3 - Prob. 5EPECh. 3 - Prob. 6EPECh. 3 - Prob. 7EPECh. 3 - Prob. 8EPECh. 3 - Prob. 9EPE
Ch. 3 - Prob. 10EPECh. 3 - Prob. 11EPECh. 3 - Prob. 12EPECh. 3 - Prob. 13EPECh. 3 - Prob. 14EPECh. 3 - Prob. 15EPECh. 3 - Prob. 16EPECh. 3 - Prob. 17EPECh. 3 - Prob. 18EPECh. 3 - Prob. 19EPECh. 3 - Prob. 20EPECh. 3 - Prob. 1PWECh. 3 - Prob. 2PWECh. 3 - Prob. 3PWECh. 3 - Prob. 4PWECh. 3 - Prob. 5PWECh. 3 - Prob. 6PWECh. 3 - Prob. 7PWECh. 3 - Prob. 8PWECh. 3 - Prob. 9PWECh. 3 - Prob. 10PWECh. 3 - Prob. 11PWECh. 3 - Prob. 12PWECh. 3 - Prob. 13PWECh. 3 - Prob. 14PWECh. 3 - Prob. 15PWECh. 3 - Prob. 1PPCh. 3 - Prob. 2PPCh. 3 - Prob. 3PPCh. 3 - Prob. 4PPCh. 3 - Prob. 5PPCh. 3 - Prob. 6PPCh. 3 - Prob. 7PPCh. 3 - Prob. 8PPCh. 3 - Prob. 1CSFCh. 3 - Prob. 2CSFCh. 3 - Prob. 3CSFCh. 3 - Prob. 4CSF
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
- Write simple C++ code as I am a beginnerarrow_forwardYou are beginning to work on a problem that needs to output names in several formats along with the corresponding Social Security number. Therefore, you need to create a C++ program which reads in a Social Security number, a first name, a middle name or initial, and a last name from the file inData.dat. The name is written to file outData.dat in three different formats: Format 1: First name, middle name, last name, and Social Security number Format 2: Last name, first name, middle name, and Social Security number Format 3: Last name, first name, middle initial, and Social Security number Format 4: Last name, middle initial, last name Note: The social security number and name in three parts on file “inData.dat”, each separated by one or more whitespaces characters: 222-33-3543 Robert James Williams Output: Write data in file “outData.dat” with proper format: Robert James Williams 222-33-3543 Williams, Robert, James…arrow_forwardI would like assistance on writing a C++ program for this problem, without using double. Thank youarrow_forward
- this is c++ homework, please tell me how to modify it.arrow_forwardHere's my instructions for a C++ program. Can anyone help me? Write a program that mimics a calculator. The program should take as input: 1. The first integer 2. The second integer 3. The operation to be performed (+, -, *, /)It should then output the numbers, the operator, and the result. (For division, if the denominator is zero, output an appropriate message. The message should contain the word "error")arrow_forwardHello, I need some help with this C programing question. I appreciate your help thanksarrow_forward
- How do you write a test plan that you can run to test each code path in your original program for C++?arrow_forwardHello, Can someone help me with the following question written in C?arrow_forwardFind the C program language Deal or No Deal?by CodeChum Admin When I was a kid, I used to watch this TV game show, Deal or No Deal? In the game, there are different brief cases, each labeled with a number. Inside each brief case is an amount in Pesos and the goal is to guess which briefcase contains the smallest amount. In this program, instead of just finding the smallest amount, your task is to ask the user for an integer input and print the values in the array smaller than the inputted integer. Instructions: In the code editor, you are provided with an array with 100 elements.Your task is to ask the user for an integer input and then print all the elements in the array whose value is lesser than the inputted integer.Input 1. Inputted integer Output Enter value: 6132450351503022244arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Structured Chart; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=vdUO-sGA1DA;License: Standard YouTube License, CC-BY
Introduction to Structure Charts; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=QN2bjNplGlQ;License: Standard Youtube License