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
there are these numbers that I've seen before but I don't know what they mean can someone help. I will give brainiest
Ne4ueva [31]

Answer:

Those numberss are binary code

Explanation:

Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit , is the smallest unit of data in computing. It is represented by a 0 or a 1. Binary numbers are made up of binary digits (bits), eg the binary number 1001.

5 0
3 years ago
Read 2 more answers
Suppose there are 69 packets entering a queue at the same time. Each packet is of size 7 MiB. The link transmission rate is 1.7
svp [43]

Answer:

69.08265412 milliseconds

Explanation:

Lets first convert 7 MiB to bits

7*1024*1024*8=58720256 bits

Now convert bits to Gbits

58720256/10^{9}  =0.058720256 Gbits

Queuing Delay = Total size/transmission link rate

Queuing Delay= \frac{0.058720256}{1.7} =0.03454132706 seconds

Delay of packet number 3 = 0.03454132706*2=0.06908265412 seconds

or 0.06908265412= 69.08265412 milliseconds

7 0
3 years ago
Which one of the secondary storage types below would be best if you wanted to edit files and re-save them to secondary storage?
jenyasd209 [6]
USB drive
the cloud
google docs
google drive
7 0
3 years ago
Simplify the Boolean expression (AB(C + BD) + AB]CD.
finlep [7]

Explanation:

Simplify the Boolean expression (AB(C + BD) + AB]CD.

6 0
3 years ago
Read 2 more answers
Can i stream videos from my phone to my android tv
OLEGan [10]
Yes, if you purchase an adapter that you plug into your phone that goes to the hdmi port on the tv. Hope this answered your question- eagle.
4 0
3 years ago
Other questions:
  • . Consider the following brute-force algorithm for evaluating a polynomial. ALGORITHM Brute Force Polynomial Evaluation(P[0..n],
    14·1 answer
  • A weak fuel to air mixture along with normal airflow through a turbine engine may result in?
    8·1 answer
  • You are on vacation and want to see where all the restaurants and trendy shops are in relation to your hotel. You remember there
    15·1 answer
  • What are the TWO methods of copying and pasting on the AutoCAD Clipboard function?
    7·1 answer
  • Need help developing code!!
    9·1 answer
  • There is only one way to change line spacing in Word.
    14·1 answer
  • The term __________ denotes data that is being stored on devices like a universal serial bus (USB) thumb drive, laptop, server,
    6·1 answer
  • In order to communicate between devices inside a computer?
    9·1 answer
  • Which of the following is true about stateless applications?
    9·1 answer
  • Four ways to improve the performance of a hard disk include.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!