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
Describe FIVE significant advantages of web-based applications for an organisation.
masya89 [10]

Answer

There are a lot of advantages of web based applications.

Explanation:

Below are the advantages:

  1. Web based applications can be accessed from device that is connected to the device.
  2. No physical software required to download, install, update or manage which saves a lot of administration work for large companies.
  3. Web based software is compatible with any device or platform. The software is delivered through a browser of the users' choice.
  4. Mobile device applications allow for access to the software when out of the office.
  5. Direct access to latest information for Employees where every they are located.

Apart from these, there are lot more benefits, like quick and easy updates, centralized data where data is secure and easy to backup.  We can reach anybody, anywhere in the world.

Business costs are drastically reduced by spending less time talking to customers over the phone.

Online training can be finished at user's own time and risk.

It's available 24 hours a day, 7 days a week

The software is always up-to-date

8 0
3 years ago
3.29 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-di
romanna [79]

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   string fname,lname; int num;

   cout<<"Firstname: "; cin>>fname;

   cout<<"Lastname: "; cin>>lname;

   cout<<"4 digits: "; cin>>num;

   string login = lname;

   if(lname.length()>=5){

       login = lname.substr(0, 5);    }

   login+=fname.substr(0,1)+to_string(num%100);

   cout<<login;

   return 0;

}

Explanation:

See attachment for explanation where I used comments to explain each line

Download cpp
4 0
2 years ago
What are the primary IP addresses for DNS servers hosted on the x128bit, iskytap and cloudparadox domains
coldgirl [10]

Answer:

208.91. 197.27 and  50.225.

Explanation:

In the world of computers, the term "IP" stands for Internet Protocol. The IP address or the Internet Protocol address is defined as a numerical label that is provided to every device which is connected to any computer network for communication. It works as providing the location address of the device and also identifies the network interface.

The primary IP addresses for the DNS servers that is hosted on :

-- x128bit is 208.91. 197.27

-- iskytap is  208.91. 197.27

-- cloudparadox is 50.225.

8 0
2 years ago
It is a science fiction but the answer is not science fiction.it States ;it's inventiveness,uncertainly and futuristic ideas typ
MAVERICK [17]

Answer:

The uncertainty of inventiveness and futuristic ideas usually deal with science and technology.

Inventibility is something uncertain which promotes a risk in any system in which it is inserted. With that, we can naturally associate it with the maintenance of science and technology, because both are in need of inventing new creations, which may or may not be effective for the defeat of uncertainties and the creation of certainties.

This is usually linked to futuristic ideas, which may not fit in today's society, but which impose improvements, or not, for societies in the future. Leading to the creation of more technologies and more sciences.

3 0
2 years ago
What are possible consequences for cyberbullying?
MrRa [10]

Answer:

Victims of cyberbullying are more likely than their peers to abuse alcohol and drugs, have physical and emotional health issues, and may suffer from low self-esteem. Poor grades in school is another consequence of cyberbullying that can also be accompanied by an attempt by the victim to avoid other children by refusing to go to school.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • In the table below identify the data type that would be most suitable for the second field
    14·1 answer
  • 2
    11·1 answer
  • A data flow cannot go directly back to the same process it leaves. There must be at least ________ other process(es) that handle
    15·1 answer
  • What is company NDR?​
    11·1 answer
  • What is a computer system?
    9·1 answer
  • How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topi
    13·1 answer
  • The _____ of a local variable is the function in which the variable is created.
    6·1 answer
  • Why is it useful for students to practice the MLA and APA citation methods?
    15·1 answer
  • WHAT TYPES OF ACTIVITIES ARE PERFORMED BY HEALTH CARE SOFTWARES
    8·1 answer
  • Which terms would be found in search for "Mo*”? Check all that apply.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!