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]
3 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]3 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
Hi guys how are you i have a question why does people delete questions and answer from brainly and where is the delete option?
Sphinxa [80]
There is no delete option sorry
3 0
3 years ago
Read 2 more answers
A group of interrelated resources acting together according to a plan to accomplish the goals of the records and information man
Verizon [17]

Answer: Record system

Explanation:

 The record system is one of the type of information storage system that stored all the records or data in the form of management system.

  • We can also retrieve the our data or information by saving it in the system so that we can use that specific data for future use.
  • It also helps in ensuring the data integrity and providing an efficient security to our data or information in the system.

 According to the given question, record system is one of the information management system that helps in accomplished the goals in the form of record.

 Therefore, Record system is the correct answer.

8 0
4 years ago
Pls help! 7th grade pythin fyi
larisa [96]

Answer:

There should be a colon at the end of the if statement, ie:

<h2>if x > 100:</h2><h2>  print("...")</h2>

8 0
3 years ago
Which of the following is used by credit card companies to determine APR?
kodGreya [7K]
Prime rate + credit history (APEX)
4 0
3 years ago
Read 2 more answers
This is in government
Anon25 [30]
I would have thought that it was C.

5 0
3 years ago
Other questions:
  • The action in which a router divides and forwards incoming or outbound message traffic to multiple links is known as
    15·1 answer
  • What are some programs that you have used that have condition-controlled loops and count-controlled loops?
    10·1 answer
  • ________ are websites that provide collections of content from all over the world wide web a. aggregators b. social networks c.
    6·1 answer
  • What is the meaning of Android
    12·2 answers
  • <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="225547404f435156475062404e434c4947560c414d4f">[email&#1
    12·2 answers
  • 1. Write a program that asks the user to enter a string. The program should then print the following: (a) The total number of ch
    11·1 answer
  • The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values on
    9·1 answer
  • The purchase of a computer by a person for household use would be counted in what category of GDP?
    15·1 answer
  • Given the following code, assume the myStack object is a stack that can hold integers and that value is an int variable. Assume
    8·1 answer
  • PLEASE HELP I WILL GIVE BRAINLIEST AND 100 POINTS IF U ANSWER COMPLETELY WITHIN 30 MIN
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!