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
Answer this and you get free 100 points
Agata [3.3K]

Answer:

thanks my dude I needed it

5 0
3 years ago
Read 2 more answers
What is the python ?​
docker41 [41]

Answer:

Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. 

3 0
3 years ago
Read 2 more answers
When you start a browser, it automatically loads and displays a page from a web site. This is known as your ____. Class: compute
EastWind [94]

Answer:

Index page.

Explanation:

The index page is the URL or local file that automatically loads when a web browser starts and when the browser's 'home' button is pressed. The term is also used to refer to the front page, web server directory index, or main web page of a website of a group, company, organization, or individual.

6 0
3 years ago
Chemical reaction to metal​
NeX [460]

Answer:

Metals can react with water, acid and oxygen. The reactivity of the metal determines which reactions the metal participates in.

Explanation:

In general, acids react with metals to give salt and release hydrogen gas. In general, bases do not react with metals and release hydrogen gas.When metals react with other substances, the metal atoms lose electrons to form positive ions .

5 0
3 years ago
Patrick wants you to repair his laptop LCD screen. Patrick insists that it was not his fault, but sometime during the night, the
Dafna1 [17]

Answer:

These are for the WiFi. On a few cards, the Bluetooth facility is being provided through the second antenna, and that is 2.4 GHz, and hence both the antennas are the same in length. And the 5 GHz comes with the wavelength which is half of that of 2.4 GHz, and this is you can use both the antennas for any out of the two frequencies and you can connect to only one Wi-Fi network at one time, however, it needs the second antenna to communicate with any device which is of type Bluetooth, and two at a time.

Explanation:

The answer is self explanatory.

5 0
3 years ago
Other questions:
  • When law enforcement becomes involved, the need may arise to freeze systems as part of the evidence. There is also the likelihoo
    5·1 answer
  • What is the proper citation for a video source? A. Video: Hank Aaron. Dir. Don Donto. VidCassette. 1985. DVD. Home Video, 1986.
    11·1 answer
  • Create a lottery game application. Generate three random numbers (see Appendix D for help in doing so), each between 0 and 9. Al
    14·1 answer
  • ____ port is a connection in which eight data lines transmit an entire byte of data at one moment in time.
    12·1 answer
  • Write the program to solve quadratic equations, but if the discriminant is negative, output
    9·1 answer
  • To use an imported image, simply drag it from the desktop onto the stage. true or false?
    14·1 answer
  • It would be system unit on this test
    7·1 answer
  • Use the following cell phone airport data speeds​ (Mbps) from a particular network. Find P10. 0.1 0.1 0.3 0.3 0.3 0.4 0.4 0.4 0.
    7·1 answer
  • Before using large downloaded files that are in a compressed format, it is necessary to_____ them. A) Copy B) Extract C) Open D)
    9·1 answer
  • Sorting Records in a Form
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!