Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. (25 Points) Write a complete, working C++ program called euidB.cpp (where euidis your EUID) that does the following: Declare the following variables: o A

image text in transcribed
2. (25 Points) Write a complete, working C++ program called euidB.cpp (where "euid"is your EUID) that does the following: Declare the following variables: o A string variable to store the name of an art gallery that contains no white space. o An integer variable to store an integer between 15 and 40, inclusively. o An integer variable to store the above integer value raised to a power. o A floating-point number to store the average price of all the pictures in the gallery An art gallery has 14 pictures. Declare and initialize a constant integer called PICTURES with the value 14. . Prompt for and read in the name of the art gallery as a single word, which contains no white space. Prompt for and read in an integer between 15 and 40, inclusively, using printf and scanf, respectively .Now, use the appropriate math function to raise this integral value (between 15 and 40) to the third power and store the result in the appropriate integral variable. This number represents the value of all of the pictures in the art gallery . Accurately calculate and store the average value of all the pictures contained in the art gallery using your constant declared above. Print the name of the art gallery and the average value of all the pictures in the art gallery, separated by the tab character. But be sure to include the '$' character before this average value. Due to time constraints, no comments are required in this code. Here is a sample output to help you write the code. The items in bold are entered by the user. s ./a.out Enter the single name of the art gallery: Momentum Enter an integer value between 15 and 40, inclusively: 26 Momentum $%1255 average per piece You may not get the same output since we are using random numbers

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions