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
irinina [24]
3 years ago
6

Suppose that the tuition for a university is $10,000 this year and increases 4% every year. In one year, the tuition will be $10

,400. Write a program using for loop that computes the tuition in ten years and the total cost of four years’ worth of tuition after the tenth year.

Computers and Technology
1 answer:
Nataliya [291]3 years ago
5 0

Answer:

<em>The programming language is not stated; however, I'll answer using Python programming language (</em><em>Se</em><em>e attachment</em><em> </em><em>for</em><em> </em><em>proper </em><em>for</em><em>mat</em><em>)</em>

tuition = 10000

rate = 0.04

for i in range(1,15):

tuition = tuition + tuition * rate

if i <= 10:

print("Year "+str(i)+" tuition:",end=" ")

print(round(tuition,2))

if i == 14:

print("Tuition 4th year after:",end=" ")

print(round(tuition,2))

Explanation:

<em>The first 2 lines initializes tuition and rate to 10000 and 0.04 respectively</em>

tuition = 10000

rate = 0.04

<em>The next line iterates from year 1 to year 14</em>

for i in range(1,15):

<em>This line calculates the tuition for each year</em>

tuition = tuition + tuition * rate

<em>The next 3 lines prints the tuition for year 1 to year 10</em>

if i <= 10:

print("Year "+str(i)+" tuition:",end=" ")

print(round(tuition,2))

<em>The next 3 lines prints the tuition at the 4th year after year 10 (i.e. year 14)</em>

if i == 14:

print("Tuition 4th year after:",end=" ")

print(round(tuition,2))

You might be interested in
Given that the array monthSales of integers has already been declared and that its elements contain sales data for the 12 months
SIZIF [17.4K]

Answer:

       System.out.println("October is the "+monthSales[9]+"th Month of the year");

A complete Java program is given in the explanation section.

Explanation:

public class num4 {

   public static void main(String[] args) {

   int [] monthSales = new int[12];

   int i=0;

   for(i = 0; i<monthSales.length; i++){

       monthSales[i] = i+1;

   }

       System.out.println("October is the "+monthSales[9]+"th Month of the year");

   }

}

In the code above, we created an an array of size 12 with this statement

int [] monthSales = new int[12];

using the for loop, the numbers 0-12 are added to the array corresponding to the twelve months in the year

The statement   System.out.println("October is the "+monthSales[9]+"th Month of the year"); outputs the corresponding number to October

5 0
2 years ago
This is your code.
topjm [15]

Answer:

11

Explanation:

the second in the d aray is c because to call the first value, it is d[0]. So, to call c, you put d[2]. And the 0 of the c array, or the 0 of the 2 of the d array, it is 11

put it in a program. I use JS so if you have an Apple, open script editor and change the script from AppleScript to JavaScript and put in this code:

var a = [5, 10, 15];

var b = [2, 4, 6];

var C = [11, 33, 55];

var d = [a, b, C];

d[2][0];

3 0
3 years ago
If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts, and created a SavingsA
Anvisha [2.4K]

Answer:

numAccounts = SavingsAccount.numberOfAccounts

Explanation:

In object oriented programming, when you have created an object of class, you can create several instances (objects) from that class by referencing the className.classFeild. In this instance SavingsAccount is the class name and

numberOfAccounts is a feild (or data member). to create a new numAccount, we use the syntax as above in the answer

3 0
3 years ago
Question 2 (2 points)
swat32

I beleive all of the above for question one

4 0
2 years ago
What are the advantages of using variables in a data type?
mixas84 [53]

Answer:

A variable is a name associated with a data value; we say that the variable "stores" or "contains" the value. Variables allow us to store and manipulate data in our programs.

5 0
2 years ago
Other questions:
  • Adding a ____ to text adds depth and helps the letters display prominently.
    5·1 answer
  • When you purchase software in a box, reading the ________ is important to know if the software will function properly?
    13·1 answer
  • A digital media professional's computer is too full of video files. She would like to upgrade her computer to have more capacity
    12·2 answers
  • Does the brain play a role in smartphone addiction
    7·2 answers
  • Someone please help me with the right answer please
    12·1 answer
  • How does a author develop a character in a story?
    14·2 answers
  • Which type of CPU instruction performs arithmetic calculations and stores the results in memory?
    14·2 answers
  • true or false You are able to change the formatting of a table after it is inserted into a placeholder.
    6·1 answer
  • What method is used in the following line of code to associate clicking the left button with the event handler "clickSingle"?
    9·1 answer
  • Discuss the concept of the “state of a process”. Give examples to illustrateyour answers?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!