Question

In: Computer Science

C++ code Output Formatting. Design and implement a complete C++ program that reads a customer record...

C++ code

Output Formatting.

Design and implement a complete C++ program that reads a customer record from the user such as the record has 4 fields (pieces of information) as shown below:

Account Number (integer)

Customer full name (string)

Customer email (string)

Account Balance (double)

The program is expected to print the record in the format shown below:

Account Number :  0000000

Name                     :  full name

Email                      :  customer email

Balance                  :  000000.00$

For example, if the user enters the following record

1201077

Jonathan I. Maletic

[email protected]

10,000.17

The program outputs:

Account Number : 1201077

Name           : Jonathan I. Maletic

Email          : [email protected]

Balance        : 10,000.17$

Solutions

Expert Solution

#include <iostream>

using namespace std;

int main() {

int accntNumber;

char name[100];

string email;

double balance;

cout<<"Enter account number : ";

cin>>accntNumber;

cout<<"Enter name " ;

cin.getline(name,sizeof(name));

cout<<"Enter name " ;

cin.getline(name,sizeof(name));

cout<<"Enter email Id: ";

cin>>email;

cout<<"Enter balance : ";

cin>>balance;

cout<<"Account Number : "<<accntNumber<<endl;

cout<<"Name\t: "<<name<<endl;

cout<<"Email\t: "<<email<<endl;

cout<<"Balance\t: "<<balance<<endl;

}

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me


Related Solutions

In C ++, Design and implement a program that reads from the user four integer values...
In C ++, Design and implement a program that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered:    95, 80, 100, 70 Highest grade: 100 Lowest grade:   70 Average grade: 86.25
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four...
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Using C# Design and implement a program (name it ProcessGrades) that reads from the user four...
Using C# Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered:   95, 80, 100, 70 Highest grade:100 Lowest grade:  70 Average grade:86.25
Design and implement a C++ program with functions to calculate the pre-tax charge: If the customer...
Design and implement a C++ program with functions to calculate the pre-tax charge: If the customer subscribes to a phone plan called Plan200, then he is charged $5 for the first 200 minutes. For each additional minutes, the customer will be charged $0.10. If the customer subscribes to a phone plan called Max20, then he is charged $0.05 for each minute up to $20. (I.e., the customer never needs to pay more than $20.) If the customer is not subscribed...
USING C# Design and implement a program (name it SumValue) that reads three integers (say X,...
USING C# Design and implement a program (name it SumValue) that reads three integers (say X, Y, and Z) and prints out their values on separate lines with proper labels, followed by their average with proper label. Comment your code properly.Format the outputs following the sample runs below. Sample run 1: X = 7 Y = 8 Z = 10 Average = 8.333333333333334
Design and implement a program that reads a series of 10 integers from the user and...
Design and implement a program that reads a series of 10 integers from the user and prints their average. Read each input value as a string, and then attempt to convert it to an integer using the Integer.parseInt method. If this process throws a NumberFormatException (meaning that the input is not a valid number), print an appropriate error message and prompt for the number again. Continue reading values until 10 valid integers have been entered.
1. Design and implement a program that reads a series of integers from the user and...
1. Design and implement a program that reads a series of integers from the user and continually prints their average after every reading. The input stops when the user enters “stop” as the input value. Read each input value as a string, then check if it is “stop” or not. If the string is not “stop”, then, attempt to convert it to an integer using the Integer.parseInt method. If this process throws a NumberFormatException, meaning that the input is not...
Design and implement a program that reads a series of 10 integers from the user and...
Design and implement a program that reads a series of 10 integers from the user and prints their average. Read each input value as a string, then attempt to convert it to an integer using the Integer.parseInt method. If this process throws a NumberFormatException (meaning that the input is not a valid integer), display an appropriate error message and prompt for the number again. Continue reading values until 10 valid integers have been entered.
Write a python code to Design and implement a function with no input parameter which reads...
Write a python code to Design and implement a function with no input parameter which reads a number from input (like 123). Only non-decimal numbers are valid (floating points are not valid). The number entered by the user should not be divisible by 10 and if the user enters a number that is divisible by 10 (like 560), it is considered invalid and the application should keep asking until the user enters a valid input. Once the user enters a...
Design and implement a Java program that creates a GUI that will allow a customer to...
Design and implement a Java program that creates a GUI that will allow a customer to order pizza and other items from a Pizza Paarlor. The customer should be able to order a variety of items which are listed below. The GUI should allow the customer (viaJavaFX UI Controls - text areas, buttons, checkbox, radio button, etc.) to input the following information: Name of the customer First Name Last Name Phone number of the customer Type of food being order...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT