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
cupoosta [38]
3 years ago
11

If apples are currently $4.99 a dozen, create a program that will determine the cost of any number of apples. Make the cost of a

dozen apples a variable as well, so that it can easily be changed if the price of apples changes.
Computers and Technology
1 answer:
CaHeK987 [17]3 years ago
7 0

Answer:

Explanation:

The following code is written in Java, it takes the cost of a dozen apples as a variable (costPerDozen), it then asks the user for the total number of apples that is places in a variable called (numberOfApples). It then calculates the total cost of the apples by dividing the costPerDozen by 12 and then multiplying by the total nuumber of apples requested. Finally it prints out the total.

 public static void main(String[] args) {

       double costPerDozen = 4.99;

       Scanner input = new Scanner(System.in);

       System.out.println("How many apples would you want?");

       int numberOfApples = input.nextInt();

       double totalCost = (costPerDozen / 12) * numberOfApples;

       System.out.println("That will cost: " + totalCost);

   }

You might be interested in
Which of the following statements is correct?
vaieri [72.5K]

Answer:

A

Explanation:

I think is A. or maybe search up the topic of the lesson

7 0
3 years ago
Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename
pickupchik [31]

Answer:

Explanation:

iname=input("Enter the file name: ")

inputfile=open(iname,'r')

lines=[]

for line in inputfile:

lines.append(line)

inputfile.close()

print("The file has ",len(lines)," lines")

while True:

linenumber=int(input("Enter the line number or 0 to quit: "))

if linenumber==0:

break

elif linenumber > len(lines):

print("Error: line number must be less than ", len(lines))

else:

print(linenumber, " : ", lines[linenumber - 1])

7 0
3 years ago
.حدد/ي الكيانات في النظام
olasank [31]

Answer:

what

Explanation:

6 0
3 years ago
Read 2 more answers
Device management is the process of managing
faltersainse [42]
Device management is the process of managing the devices in your computer. In your computer you have the so-called device manager, in which all the drivers of your devices are installed. Device Manager allows you to monitor and manage each of its devices. You can also uninstall and update your devices in device manager. And the process of doing it is called device management. It is very simple to do this kind of stuffs as long you are familiar with your devices like mouse, printer, keyboard, etc.
8 0
3 years ago
What is most likely kept in as database
belka [17]
Sales reports,employee records,logged passwords   somebody has already asked this question
4 0
3 years ago
Other questions:
  • Two fingers are assigned to six letters each. What fingers are they?
    9·1 answer
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • Suppose you want to view a document that has several headings. what view would you use?
    6·1 answer
  • A researcher wants to do a web-based survey of college students to collect information about their sexual behavior and drug use.
    15·1 answer
  • What software maintain and increase the efficiency of a computer system?
    12·1 answer
  • Plz tell the answer I I'll mark u as the brainliest
    14·1 answer
  • Select four tasks associated with operating system maintenance. Cleaning inside the computer Defragmenting the hard drive Deleti
    11·1 answer
  • 5. Robotics deals with the design, construction, operation, and use of robots, as well as computer systems for their control, se
    14·1 answer
  • Algorithm to calculate the area of a square.​
    6·1 answer
  • What three best practices can help defend against social engineering attacks?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!