Answer:
13
Explanation:
int numA = 4;
whilie (numA < 12){
numA += 3;
}
System.out.print(numA);
numA numA < 12
4 true <em>⇒ numA increases by 3, loop continues </em>
7 true <em>⇒ numA increases by 3, loop continues </em>
10 true<em> ⇒ numA increases by 3, loop continues</em>
13 false <em>⇒ loop stops, program them prints out value of numA </em>
You can use backup utility programs and file management programs.
Answer:
Prototype
I think this is the word ur looking for!
Answer:
num1 = int(input("Numerator: "))
num2 = int(input("Denominator: "))
if num1 < 1 or num2<1:
print("Input must be greater than 1")
else:
print("Quotient: "+str(num1//num2))
print("Remainder: "+str(num1%num2))
Explanation
The next two lines prompts the user for two numbers
<em>num1 = int(input("Numerator: "))</em>
<em>num2 = int(input("Denominator: "))</em>
The following if statement checks if one or both of the inputs is not positive
<em>if num1 < 1 or num2<1:</em>
<em> print("Input must be greater than 1")-> If yes, the print statement is executed</em>
If otherwise, the quotient and remainder is printed
<em>else:</em>
<em> print("Quotient: "+str(num1//num2))</em>
<em> print("Remainder: "+str(num1%num2))</em>
<em />
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))