Computer Science Homework 2 - Each .cpp program should

Question # 00856767 Posted By: wildcraft Updated on: 06/28/2024 11:20 PM Due on: 06/29/2024
Subject Computer Science Topic General Computer Science Tutorials:
Question
Dot Image

Computer Science Homework 2

Homework 2

Submit the .cpp source code file(s) on Ecampus.

Each .cpp program should have comments at the top that include your name, homework number, and what the program does. (1) Write a program that prints the ASCII Art elephant shown below. (2) Write a program that prompts the user to enter three numbers, then prints the sum and product of these numbers. (3) Write a program that prompts the user to enter a radius.  Using this radius, print the area of a circle, volume of a sphere, and surface are of a sphere. It is o.k. to combine these 3 problems into a single .cpp program.  This .cpp file must be compilable - only one main() function.

 

Below is a sample output for this homework assignment.

Program 1 Output

/ \~~~/ \

,----( .. )

/ \__ __/

/| (\ |(

^ \ /___\ /\ | hjw

|__| |__|-" `97

Program 2 Output This program calculates the sum and product of three numbers. Enter the first number:  2.1 Enter the second number:  3 Enter the third number:  5.5 The sum of these three numbers is 10.6 The product of these three numbers is 34.65  

Program 3 Output This calculates the area of a circle, volume of a sphere, and surface area of a sphere. Enter a radius in inches:  3.3 Area of a circle is 34.21 square inches Volume of a sphere is 150.53 cubic inches Surface area of a sphere is 136.85 square inches

Dot Image
Tutorials for this Question
  1. Tutorial # 00852258 Posted By: wildcraft Posted on: 06/28/2024 11:21 PM
    Puchased By: 2
    Tutorial Preview
    The solution of Computer Science Homework 2 - Each .cpp program should...
    Attachments
    Computer_Science_Homework_2_-_Each__cpp_program_should.ZIP (18.96 KB)

Great! We have found the solution of this question!

Whatsapp Lisa