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
A(n) ____ is an entry in a cell that contains text such as "2016 Sales" or "Travel Expenses."
slavikrds [6]

Answer:

B- label

Explanation:

A label is an entry such as a text within a cell that describes particular rows and columns. Labels are usually found at the top of the particular row/column they are identifying.

Hence, the texts "2016 Sales" and "Travel Expenses" are labels that identify cells such as the values of the sales in 2016 of a company and expenses spent on travel in a year of a family.

6 0
4 years ago
How does an Ac Machine work
Pani-rosa [81]

Answer:

In a split system, the compressor condenses and circulates the refrigerant through the outdoor unit, changing it from a gas to a liquid. The liquid is then forced through the indoor evaporator coil or cooling compartment. The indoor unit's fan circulates the inside air to pass across the evaporator fins.

Explanation:

(hope this helps)

6 0
3 years ago
What does the term measure refer to in typography
olchik [2.2K]

You're right, the correct answer is C.


6 0
3 years ago
Read 2 more answers
Q1. Information systems that monitor the elementary activities and transactions of the organizations are: I a. Management-level
VashaNatasha [74]

Answer:

B. Operational-level systems monitor the elementary activities and transactions of the organization.

6 0
2 years ago
Assignment 8: Personal Organizer (in edhesive or python please)
serg [7]

Answer:

eventName = []

eventMonth = []

eventDay = []

eventYear = []

def addEvent():

   userEventName = input("Enter event name: ")

   userEventMonth = int(input("Enter event month (1-12): "))

   userEventDay = int(input("Enter event day(1-31): "))

   userEventYear = int(input("Enter event year (Ex:2020): "))

   userEventMonth = validateMonth(userEventMonth)

   userEventDay = validateDay(userEventMonth,userEventDay,userEventYear)

   

   eventName.append(userEventName)

   eventMonth.append(userEventMonth)

   eventDay.append(userEventDay)

   eventYear.append(userEventYear)

   

def validateMonth(month):

   if month >= 1 and month <= 12:

       return month

   else:

       return 1

def validateDay(month,day,year):

   # invalid days

   if day < 1 or day > 31 :

       return 1

   

   # if the month is february

   if month == 2:

       isleap = False

       if year%4 == 0:

           if year%100 == 0:

               if year%400 == 0:

                   isleap = True

           else:

               isleap = True

       # if the year is leap

       if isleap:

           if day < 30:                

return day

           else:

               return 1

       else:

            if day < 29:

               return day

            else:

               return 1

           

    # month with 31 days

   if month in [1,3,5,7,8,10,12]:

       return day

    # month with 30 days

   if month in [4,6,9,11] and day < 31:

       return day

   else:

       return 1

           

def printEvents():

   print("****** LIST OF EVENTS *********")

   

   months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',

         'August', 'September', 'October', 'November', 'December']

   

   for index in range(len(eventName)):

       print(eventName[index])

       print("Date: "+months[eventMonth[index] -1]+ " " + str(eventDay[index]) + ", " + str(eventYear[index]))

def printEventsForMonth(month):

   months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',

         'August', 'September', 'October', 'November', 'December']

   print("****** EVENTS IN " + months[month -1] + " *********")

   

   for index in range(len(eventName)):

       if eventMonth[index] == month:

           print(eventName[index])

           print("Date: "+months[eventMonth[index] -1]+ " " + str(eventDay[index]) + ", " + str(eventYear[index]))

userChoice = "yes"

while userChoice.upper() != "NO":

   addEvent()

   userChoice = input("Do you want to enter another event? NO to stop: ")

printEvents()

Explanation:

hope this saved somebody from a mental breakdown :)

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • Tiff is the default file format for most digital cameras. <br> a. True <br> b. False
    12·1 answer
  • Give a big-O estimate for the number of operations,
    5·1 answer
  • A common use-case for dictionaries is to store word counts. Let's modify our program below to store the count for each unique wo
    9·1 answer
  • You are an online training company and stream a lot of training videos from your
    12·1 answer
  • Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The fi
    5·1 answer
  • How would asking questions or defining problems be used in this career?<br> -
    13·1 answer
  • 23+ Composition refers to
    11·1 answer
  • PLEASE HURRY!!!!<br> Look at the image below
    8·1 answer
  • Who does online school on FLVS???????????????????
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!