ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 11 Weeks Ago, 1 Day Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 04 May 2017 My Price 8.00

Write a program to calculate the out-of-pocket cost

A high school senior is applying for colleges.  He wants a program to calculate the out-of-pocket cost for attending each college he is applying.  The out-of-pocket cost is determined by the following formula:

 

out-of-pocket cost = tuition + room + board + other expenses – financial aid

 

Write a program to calculate the out-of-pocket cost of every college he is applying.  After each college, ask the user whether to calculate cost for another college.  Enter ‘y’ for yes.  The following is an example:

 

Enter name of college: Wake Tech

Enter tuition: 8500

Enter room: 6000

Enter board: 4000

Enter other expenses: 3000

Enter financial aid: 2000

Out-of-pocket cost for this college: 19500

Calculate cost for another college? [y/n] y

 

Enter name of college: Jefferson College

Enter tuition: 35000

Enter room: 7000

Enter board: 4500

Enter other expenses: 5000

Enter financial aid: 22000

Out-of-pocket cost for this college: 29500

Calculate cost for another college? [y/n] y

 

Enter name of college: Freedom University

Enter tuition: 20000

Enter room: 10000

Enter board: 5000

Enter other expenses: 5000

Enter financial aid: 30000

Out-of-pocket cost for this college: 10000

Calculate cost for another college? [y/n] n

 

Save your Python program in a file named Lab04P1.py.  Submit the file to Blackboard for credit.

 

Problem 2

  

We wrote the following program to calculate BTU needed to cool a room.

 

roomLength = float(input('Enter room length: '))
roomWidth = float(input('Enter room width: '))
roomHeight = float(input('Enter room height: '))
roomVolume = roomLength * roomWidth * roomHeight
btuNeeded = roomVolume * 3.5
print('BTU needed for this room:', btuNeeded)

 

Modify the program by adding error checking loops.  Room length, width and height must all be greater than 0. Every time the user enters a negative number, display an error message and ask the user to re-enter a valid value immediately. 

Answers

(11)
Status NEW Posted 04 May 2017 02:05 AM My Price 8.00

-----------

Not Rated(0)