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
gregori [183]
3 years ago
6

This code snippet is intended to calculate the balance of an account after twenty years of gaining interest. Select the statemen

t that correctly completes the loop.
int years = 20;
double balance = 10000;
while (years > 0)
{
__________
double interest = balance * rate / 100;
balance = balance + interest;
}
Computers and Technology
1 answer:
Firlakuza [10]3 years ago
8 0

Answer:

The answer to this question is the "years--;".

Explanation:

In the given question code the if we define the years--; and the rate of interest in the code so this program will return a value for example if we give rate of interest or rate to value 5 then the output of the code is 26532.977051  because it returns the double that is a floating-point value.  So the missing code for this question is "years--;".

 

You might be interested in
You have been doing a lot of web surfing lately as part of your research for your course and along the way you have noticed a gr
creativ13 [48]

The generated code component that executes on the web server is the following does Laura tell you is NOT a component of the active server page.

a. the generated code component that executes on the web server

<u>Explanation:</u>

Asp technology is where it is a combination of both  HTML and visual basic programming. Asp web pages are executed in server and display as Html to the end-users.

With the HTML coding, only static pages can be developed whereas through ASP web pages are developed and which contains visual basic coding languages and for client-side validates in ASP web pages either javascript or visual basic scripts are used.

Each ASP web pages are compiled at the server end and executed and complied out HTML pages are shown in web pages.

We need to install the ASP component at the server to execute the ASP web pages.

3 0
2 years ago
Sort short_names in reverse alphabetic order.
tangare [24]

lst = short_names.split()

print(sorted(lst,reverse = True))

6 0
2 years ago
What is the argument in this function =AVERAGE(F3:F26)
monitta
The argument for the function would be answer "D".
5 0
2 years ago
Components of an operating system include process,memory,and file management. what is another component of and operating system
kirza4 [7]

Answer:

Wrong it's actually C.

Explanation:

APEX

4 0
2 years ago
Read 2 more answers
Write a program that teaches arithmetic to a young child. The program tests addition and subtraction. In level 1 it tests only a
Natasha2012 [34]

Answer:

import random

class Arithmetics(object):

   trial = 2

   score = 0

   is_end = "Y"

   

   def start(self):

       while self. is_end == "Y":

           self. level1()

           self. level2()

           self. level3()

           self. is_end = input("Do you want to play again? Y/N: "). upper()

       quit()

   def level1(self):

       print("--------------------Level 1--------------------\n\n Addition:")

       for _ in iter(list, 0):

           num1 = random.randint(1,5)

           num2 = random.randint(1,5)

           if self. score == 5:

               print("Congrat! advance to next level\n")

               self. init_()

               break

           print(f"{num1} + {num2}")

           result = int(input("Your answer: "))

           if result == num1 + num2:

               self. increase_score()

           elif self. trial == 0:

               print("Sorry dear, you failed to pass the text.")

               self. end_game()

           else:

               self. trial_reduce()

   def level2(self):

       print("--------------------Level 2--------------------\n\n Addition again:")

       for _ in iter(list, 0):

           num1 = random. randint(1,9)

           num2 = random. randint(1,9)

           if self. score == 5:

               print("Congrat! advance to next level\n")

               self. init_()

               break

           print(f"{num1} + {num2}")

           result = int(input("Your answer: "))

           if result == num1 + num2:

               self. increase_score()

           elif self. trial == 0:

               print("Sorry dear, you failed to pass the text.")

               self. end_game()

           else:

               self. trial_reduce()

   def level3(self):

           print("--------------------Level 3--------------------\n\n Subtraction:")

           for _ in iter(list, 0):

               denum = random. randint(6,9)

               num = random. randint(1,5)

               if self. score == 5:

                   self. init_()

                   self. end_game()

                   break

               print(f"{denum} - {num}")

               result = int(input("Your answer: "))

               if result == denum - num:

                   self. increase_score()

               elif self. trial == 0:

                   print("Sorry dear, you failed to pass the text.")

                   self. end_game()

               else:

                   self. trial_reduce()

   #classmethod

   def trial_reduce(cls):

       cls. trial -= 1

   #classmethod

   def increase_score(cls):

       cls. score += 1

   #classmethod

   def init_(cls):

       cls. trial = 2

       cls. score = 0

   def end_game(self):

       print("Congrats kiddo! You are a math wiz.")

game = Arithmetics()

game. start()

Explanation:

The python class defines the arithmetics class with three-level mathematics for children defined as methods for the class. There are three class methods namely; 'trial_reduce', 'increase_score', and 'init_' with each of them decreasing the trial attribute, increasing the score attribute by one, and initializing the class attributes to its initial state.

The 'end_game' prints a message at the end of the program. Each level is in a loop and counts five times if the answers are correct.

7 0
3 years ago
Other questions:
  • The item that is clicked in a JList can be retrieved using the _____ method of JList.
    8·1 answer
  • What option is used to combine several objects so that they can be treated as a single unit
    6·1 answer
  • Instructions
    12·1 answer
  • 2. Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the firs
    15·1 answer
  • Rutherford concluded from his calculations that the volume of an atom is filled with protons, neutrons and electrons. is mostly
    14·1 answer
  • Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter
    7·1 answer
  • History timeline: who developed what elements first Windows OS and Apple OS?
    13·2 answers
  • Complete the problem about Olivia, the social worker, in this problem set. Then determine the telecommunications tool that would
    11·1 answer
  • Which of the following screen elements is a horizontal bar that displays at the
    8·1 answer
  • Which of these can be a problem for people with accessibility issues? Select 4 options.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!