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
Zigmanuir [339]
3 years ago
7

If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts, and created a SavingsA

ccount object referenced by the variable account20, which of the following will assign numberOfAccounts to numAccounts?
A) numAccounts = SavingsAccount.numberOfAccoun ts;B) numAccounts = numberOfAccounts;C) numAccounts = account20.numberOfAccounts;D) None of the above, you cannot reference a static data member.
Computers and Technology
1 answer:
Anvisha [2.4K]3 years ago
3 0

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

You might be interested in
Is a network traffic management device used to connect different network segments together?
son4ous [18]
No, network traffic management software is only concerned with the health of the Network.
7 0
3 years ago
In Python Calculate the BMI of a person using the formula BMI = ( Weight in Pounds / ( ( Height in inches ) x ( Height in inches
makvit [3.9K]

Answer:

weight_pounds=float(input("Enter the weight in pounds:\n"))#taking input of weight.

height_inches=float(input("Enter the height in inches:\n"))#taking input of thye height.

bmi=(weight_pounds/(height_inches**2))*703#calculating the bmi.

print('The body mass index is '+str(bmi))#printing the result.

Ouput:-

Enter the weight in pounds:

207.8

Enter the height in inches :

72

The body mass index is 28.163395061728398

Explanation:

The above written program is in python.First I have taken input from the user of the weight in pounds then taking input of the height in inches.Then calculating the bmi and storing it in the variable bmi.Then printing the bmi in the end.

6 0
3 years ago
Use JavaWrite a program that will simulate a change machine found at cash registers. Input the amount due and amount paid from t
Ksju [112]

Answer:

Here is the JAVA program:

import java.util.Scanner;  //to accept input from user

public class Main { // class name

 public static void main(String [] args) {  // start of main method

   Scanner input = new Scanner(System.in);  // creates Scanner class object to take input from user

   System.out.println("Please Enter the Cost of the Item: ");  // prompts user to enter the cost of item

   double itemCost = input.nextDouble();  //scans and reads the input value of item cost

   System.out.println("Please Enter the Amount Paid: ");  // prompts user to enter the amount paid

   double amount = input.nextDouble();  //scans and reads the value of amount from user

   int change = (int)(amount * 100 - itemCost * 100);  //compute the remaining amount i.e. change

   System.out.println("Change Owed: " + change / 100.0);  // displays the owed change

   int quarters = change / 25;  // computes the value for quarters

   change = change % 25;  // compute the quarters remaining

   int dimes = change / 10;  //  computes dimes

   change = change % 10;  //  computes dimes remaining

   int nickels = change / 5;  // computes nickels

   change = change % 5;  // compute nickels remaining

   int pennies = change;  // computes pennies

   System.out.println("Quarters: " + quarters);  // displays computed value of quarters

   System.out.println("Dimes: " + dimes);  // displays value of dimes

   System.out.println("Nickels: " + nickels);  // displays value of nickels

   System.out.println("Pennies: " + pennies);   }} //displays value of pennies

Explanation:

I will explain the program with an examples.

Suppose the user enters 4.57 as cost of the item and 5.00 as amount paid. Then the program works as follows:

Change is computed as

change = (int)(amount * 100 - itemCost * 100);

This becomes;

change = (int)(5.00 * 100 - 4.57 * 100)

            = 500 - 457

change = 43

Now the change owed is computed as:

change / 100.0 = 43/100.0 = 0.43

Hence change owed = 0.43

Next quarters are computed as:

quarters = change / 25;

This becomes:

quarters = 43/25

quarters = 1

Now the remaining is computed as:

   change = change % 25;

This becomes:

   change = 43 % 25;

  change = 18

Next the dimes are computed from remaining value of change as:

dimes = change / 10;

dimes = 18 / 10

dimes = 1

Now the remaining is computed as:

   change = change % 10;

This becomes:

   change = 18 % 10

  change = 8

Next the nickels are computed from remaining value of change as:

nickels = change / 5;

nickels = 8 / 5

nickels = 1

Now the remaining is computed as:

   change = change % 5;

This becomes:

   change = 8 % 5

  change = 3

At last the pennies are computed as:

pennies = change;

pennies = 3

So the output of the entire program is:

Change Owed: 0.43                                                                                                                Quarters: 1                                                                                                                      Dimes: 1                                                                                                                         Nickels: 1                                                                                                                       Pennies: 3  

The screenshot of the output is attached.

7 0
3 years ago
RDBMS stands for_________________
Aliun [14]
The term "RDBMS" stands for <span>relational database management system. 

I hope this helped! :)</span>
4 0
3 years ago
What describes Accenture's approach to automation?
kogti [31]

human center because we describe stuff by what we see and obserevs

4 0
2 years ago
Read 2 more answers
Other questions:
  • When you enter search keywords in the search box of file explorer and the onedrive option is selected?
    15·2 answers
  • The analog signals that carry analog or digital data comprise composites built from combinations of simple sine waves.
    12·1 answer
  • When you hack a website, do you enter in the master code in the html section code data, or the offline/online system?
    14·1 answer
  • Suppose company A wants to develop a program that duplicates the functionality of a programm by company B. Describe how company
    8·1 answer
  • Henrietta, the owner of a very successful hotel chain in the Southeast, is exploring the possibility of expanding the chain into
    15·1 answer
  • Do people answer questions more on this site or be on social more ??? no right or wrong answer your opinion
    6·1 answer
  • A cpu handless all the instruction that it recieces from hard ware and software which are available on the computer true or fals
    7·1 answer
  • Question 1 of 10
    15·1 answer
  • Can you exclude header rows from sort in excel?
    8·1 answer
  • Write a method that makes the input string of sentences ending with and
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!