C++ LAB HELP!!!
I got a bad grade for this C++ lab, and I was wondering what would be the right way to do this while keeping in mind that we cannot use arrays. If anyone knows, please help me as my professor is not responding to my inquiries at this time. THIS IS C++! I asked this question earlier but got the answer in a different language (Java) which did not help me. PLEASE HELP!
Function Lab (C++ ONLY!!! NO JAVA OR PYTHON! C++ ONLY!)
Sample output: C++ is used for this lab
How many boxes do you want to measure? 3
Box 1:
Enter height, width, and depth: 3 4 5
Volume for box 1 is: 60
Box 2:
Enter height, width, and depth: 1.5 2.4 3.6
Volume for box 2 is: 12.96
Box 3:
Enter height, width, and depth: 2 2 2
Volume for box 3 is: 8
Goodbye
Instructions: C++ ONLY!!!
1. Prototype a double function named GetBoxVolume.
2. Prototype a void function named GetBoxSides.
3. In the main function:
a. Ask how many boxes to measure.
b. Write a loop to measure that many boxes.
c. Inside the loop:
i. Identify the box number, e.g. Box n: (see sample output)
ii. Call GetBoxSides.
iii. Display: “Volume for box n is “ (see sample output)
iv. Call GetBoxVolume.
v. Display the volume.
d. Display: “Goodbye” before exiting the main function.
Below the main function: C++ ONLY
4. Define GetBoxVolume that returns height times width time depth.
5. Define GetBoxSides that prompts the user for and gets the height, width, and depth.
While the function return types are included in the prototype instructions, you must determine the parameters.
Declare whatever variables you need.
C++ ONLY for this lab.
Step by stepSolved in 3 steps
- Hello, I am working on C++. Java seems a little confusing to me. Can this be explained in C++. Thanks.arrow_forwardCan you please do it in C++ as well?arrow_forwardShould we use fully qualified or unqualified references for variables and objects in our code? The influence of C's encapsulation problems on C++ and related topics.arrow_forward
- Hi everyone I'm learning c++ but I don't understand pass-by-value and pass-by-reference. What is (const &)? Why do we have to pass const with & but not just &? please explain, thank you so much!arrow_forwardThis code is in Ada code in Ada Please Not in C code Please type your solution out in working code don't just give me an example they may just confuse me more Below is Number_Theory.adb with Ada.Numerics.Generic_Elementary_Functions; package body Number_Theory is -- Instantiate the library for floating point math using Floating_Type. package Floating_Functions is new Ada.Numerics.Generic_Elementary_Functions(Floating_Type); use Floating_Functions; function Factorial(N : in Factorial_Argument_Type) return Positive is begin -- TODO: Finish me! -- -- 0! is 1 -- N! is N * (N-1) * (N-2) * ... * 1 return 1; end Factorial; function Is_Prime(N : in Prime_Argument_Type) return Boolean is Upper_Bound : Prime_Argument_Type; Current_Divisor : Prime_Argument_Type; begin -- Handle 2 as a special case. if N = 2 then return True; end if; Upper_Bound := N - 1; Current_Divisor…arrow_forwardWhen we are talking about c++ and our code, what does abstraction mean? Please explain in detail thanksarrow_forward
- 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