1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OverLord2011 [107]
2 years ago
5

I have been working on this python program for a hour now, and I am trying to figure out what I an doing wrong in the loop. I ha

ve attached the code and screenshot of my work. I need help to figure out how to loop the rest of the years for a calculation. The calculation has looped the same result for all years.
This is the assignment:
In 2017, the tuition for a full time student is $6,450 per semester. The tuition will be going up for the next 7 years at a rate of 3.5% per year. Write your python program using a loop that displays the projected semester tuition for the next 7 years. You should display the actual year (2018, 2019, through 2024) and the tuition amount per semester for that year.
Here is my code:
# declare global constant variables
startingTuition = 6450.00;
starting_tuitionYear = 2018;
ending_tuitionYear = 2025;
increment = 1;
rate = .035;
tuition = 0;
tuitionRate = 0;
#loop for the next 7 years
for year in range(starting_tuitionYear, ending_tuitionYear, increment):
# calculate rate per year
tuitionRate = (rate)*startingTuition;
# add rate per year to the tuition fee
tuition = startingTuition + tuitionRate;
print('Tuition for the year of ' + str(year)+ ' is ' + str(tuition));
Computers and Technology
1 answer:
Alona [7]2 years ago
7 0

Answer:

The correct loop is as follows:

for year in range(starting_tuitionYear, ending_tuitionYear, increment):

   tuition = startingTuition + rate * startingTuition

   startingTuition = tuition

   print('Tuition for the year of ' + str(year)+ ' is ' + str(tuition));

Explanation:

Required

The correction to the attached program

Some variables are not needed; so, I've removed the redundant variables.

The main error in the program is in the loop;

After the tuition for each year has been calculated, the startTuition of the next year must be set to the current tuition

<em>See attachment for complete program</em>

You might be interested in
Which type of cloud computing offers easily accessible software and applications on the machines?
blsea [12.9K]

Answer

Software as a service

Explanation

Software as a service (SAAS) is a software distribution model in which a third-party provider hosts applications and makes them available to customers over the Internet. SAAS is one of three main categories of cloud computing.

Cloud computing is the use of internet  to access hardware and software service instead of keeping regular physical hardware and software in the office space. Basically it is the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.

6 0
2 years ago
WILL GIVE BRAINLIEST!!!!!! 10 POINTS!!!!
stepladder [879]

Answer:

javascript?

Explanation: idrk

4 0
3 years ago
Read 2 more answers
A ____ by a design professional is used to determine the best system to provide the appropriate level and type of protection.
AleksAgata [21]
A HAZARD EVALUATION by a design professional is used to determine the best system to provide the appropriate level and type of protection. Hazard evaluation involves systematic identification and analysis of hazards that are associated with a particular product or process. This gives one the opportunity to avoid these hazards.  
8 0
3 years ago
The factors of power of device
LUCKY_DIMON [66]

Answer:

tfopod

Explanation:

5 0
2 years ago
12. In 2009, __________ of all pedestrian fatalities were caused by impaired drivers
makvit [3.9K]
3% of pedestrian fatalities were caused by impaired drivers  
4 0
2 years ago
Read 2 more answers
Other questions:
  • Microsoft has developed the Active Directory Domain structure so that a central authority, called the __________, is the reposit
    7·1 answer
  • A Silicon Valley billionaire purchases 3 new cars for his collection at the end of every month. Let a_n denote the number of car
    8·1 answer
  • Using a personal computer to produce high quality printed documents.
    10·1 answer
  • Importance of availability of mobile devices content that is of interest for users.
    12·1 answer
  • How important is the mail merge feature of microsoft word in different organization.?
    8·2 answers
  • Zach would like to reuse a spreadsheet that he created last year. However, he will need to delete the contents of several cells.
    5·1 answer
  • What is required to contain warnings, after several studies that have shown that they are a suffocation risk?
    15·2 answers
  • Write the code for invoking a method named sendsignal. there are no arguments for this method . assume that sendsignal is define
    12·1 answer
  • Write bash script which takes array as an input of size 10 bind its even indexes to accept even values and odd indexes to accept
    5·1 answer
  • Who is the father of computer?​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!