Solved-Homework 1- Solution

$30.00 $19.00

Please refer to Blackboard (at the top of Course Materials) for submission guidelines. The purpose of this assignment is to get you used to the C++ language. You are not expected to use classes (but if you do, that’s fine). DO NOT FORGET TO INCLUDE A README FOR EACH PROGRAM AND MAKE SURE YOUR PROGRAM…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

5/5 – (2 votes)

Please refer to Blackboard (at the top of Course Materials) for submission guidelines. The purpose of this assignment is to get you used to the C++ language. You are not expected to use classes (but if you do, that’s fine).

DO NOT FORGET TO INCLUDE A README FOR EACH PROGRAM AND MAKE SURE YOUR PROGRAM IS PROPERLY INDENTED. Your README will obviously be very simple at this point in the semester.

Problem 1 (20 points)-Write a program. Submit a file named weight.cpp

Create a program that continuously allows a user to enter his or her weight in either pounds or kilos. The program should then convert the given weight.

Possible Sample Run 1 (your program does not have to match the following exactly, but should have the same functionality):

Please enter your name and weight. James 182 pounds Hi James- you weigh 82.5 kilos.

Please enter your name and weight. Connor 78 Not enough info to convert.

Please enter your name and weight. Connor 78 kilos Hi Connor-you weigh 171.9 pounds.

Please enter your name and weight. exit

Exiting…

Problem 2 (20 points)-Write a program. Submit a file named shapes.cpp

Create a program that continuously allows a user to enter a 2D shape and output information about calculations for this shape. The program should keep track of the number of shapes input by the user.

YOU decide what shapes and information are available for display (meaning programs may intake and output different information) . A minimum of 3 shapes must be available for display. If there is no shape information available, it should be indicated to the user.

Possible Sample Run 1 (your program does not have to match the following exactly, but should have the same functionality):

********

Shapes!

********

  1. Shape: Triangle area=(base*height)/2

  1. Shape: Square area=length*length perimeter=4*length

  1. Shape: Diamond

Sorry, information for this shape is not available.

4. Shape: exit

-3 shapes entered.

Exiting…

Problem 3 (60 points)-Write a program. Submit a program named closet.cpp

Marko wants to clean out and sell some of the items in his closet. He has asked you to create a program to help him do this. The program should allow him to enter the products he wants to sell (along with the price) and then continuously allow customers to look for a product and buy it. Marko should be able to check at any time the amount of money he has made from sales.

Possible Sample Run 1 (your program does not have to match the following exactly, but should have the same functionality):

Hello closet cleaner! Enter your name: Marko How many items do you want to sell? 3

Enter item and price: belt 3.50

Enter item and price: shoes 8.75

Enter item and price: pants 4.25

***************

Marko’s Closet!

***************

Hello shopper! What item are you looking for? Shoes

We have shoes for $8.75. Would you like to buy them? yes Ok!

Hello shopper! What item are you looking for? sunglasses Sorry! We don’t have that.

Hello shopper! What item are you looking for? check balance Hello Marko! So far you have made $8.75.

Hello shopper! What item are you looking for? exit Bye!