Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++) Write programs for the following (VS17 Express) - Consider the following program in which the statements are in the incorrect order. Rearrange the statements

(C++)

Write programs for the following (VS17 Express)

- Consider the following program in which the statements are in the incorrect order. Rearrange the statements so that the program prompts the user to input the height and the radius of the base of a cylinder and outputs the volume and surface area of the cylinder. Format the output to two decimal places.

#include

#include

int main()

{}

double height;

cout<<"Volume of the cylinder ="

<

cout<<"Enter the height of the cylinder:";

cin>>radius;

cout<

return 0;

cout<<"Surface area:"

<<2*PI *radius* height + 2 * PI * pow(radius, 2.0)

<

cout<

cout<<"Enter the radius of the base of the cylinder:";

cin>>height;

cout<

#include

const double PI=3.14159;

- Three employees in a company are up for a special pay increase. You are given a file, say Ch3_Ex6Data.txt, with the following data:

Miller Andrew 65789.87 5

Green Sheila 75892.56 6

Sethi Amit 74900.50 6.1

Each input line consists of an employees last name, first name, current salary, and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87, and the pay increase is 5%. Write a program that reads data from the specified file and stores the output in the file Ch3_Ex6Output.dat. For each employee, the data must beoutputinthefollowingform:firstNamelastName updatedSalary. Format the output of decimal numbers to two decimal places.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions

Question

using signal flow graph

Answered: 1 week ago

Question

Persuasive Speaking Organizing Patterns in Persuasive Speaking?

Answered: 1 week ago