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
Firlakuza [10]
2 years ago
12

Mika forgot to put in the function name in his function header for the code below. What would be the best function header?

Computers and Technology
2 answers:
Aleksandr-060686 [28]2 years ago
6 0

Answer:

i think its the first option

Explanation:

NISA [10]2 years ago
6 0

Answer:

I believe its the first option

Explanation:

You might be interested in
To change the backround color of a page, which tab would you use?
ivann1987 [24]
I have concluded the answer is a
4 0
3 years ago
Read 2 more answers
Create an application for a library and name it FineForOverdueBooks. TheMain() method asks the user to input the number of books
andrew11 [14]

Answer:

//The Scanner class is imported which allow the program to receive user input

import java.util.Scanner;

//Class Solution is defined to hold problem solution

public class Solution {

   // The main method which signify the begining of program execution

   public static void main(String args[]) {

       // Scanner object 'scan' is defined to receive input from user keyboard

       Scanner scan = new Scanner(System.in);

       // A prompt is display asking the user to enter number of books

       System.out.println("Please enter number of books: ");

       // the user response is assigned to numberOfBook

       int numberOfBook = scan.nextInt();

       // A prompt is displayed asking the user to enter the number of days over due

       System.out.println("Please enter number of days over due: ");

       // the user response is assigned to numberOfDaysOverDue

       int numberOfDaysOverDue = scan.nextInt();

       //displayFine method is called with numberOfBook and numberOfDaysOverDue as arguments

       displayFine(numberOfBook, numberOfDaysOverDue);

   

   }

   

   //displayFine method is declared having two parameters

   public static void displayFine(int bookNumber, int daysOverDue){

       // fine for first seven days is 10cent which is converted to $0.10

       double firstSevenDay = 0.10;

       // fine for more than seven days is 20cent which is converted to $0.20

       double moreThanSevenDay = 0.20;

       // the fine to be paid is declared

       double fine = 0;

       // fine is calculated in the following block

       if(daysOverDue <= 7){

           //the fine if the over due days is less than or equal 7

           fine = bookNumber * daysOverDue * firstSevenDay;

       } else{

           // the extra days on top of the first seven days is calculated and assigned to extraDays

           int extraDays = daysOverDue - 7;

           //fine for first seven days is calculated

           double fineFirstSevenDays = bookNumber * 7 * firstSevenDay;

           // fine for the extradays is calculated

           double fineMoreThanSevenDays = bookNumber * extraDays * moreThanSevenDay;

           // the total fine is calculated by adding fine for first seven days and the extra days

           fine = fineFirstSevenDays + fineMoreThanSevenDays;

       }

       // The total fine is displayed to the user in a nice format.

       System.out.printf("The fine for " + bookNumber + " book(s) for " + daysOverDue + " day(s) is: $%.02f", fine);

   }

}

Explanation:

The program first import Scanner class to allow the program receive user input. Then the class Solution was defined and the main method was declared. In the main method, user is asked for number of books and days over due which are assigned to numberOfBook and numberOfDaysOverDue. The two variable are passed as arguments to the displayFine method.

Next, the displayFine method was defined and the fine for the first seven days is calculated first if the due days is less than or equal seven. Else, the fine is calculated for the first seven days and then the extra days.

The fine is finally displayed to the user.

4 0
3 years ago
Troy, an aspiring screenwriter, aspires to work with a famous director known for his philanthropic work. Troy gets an appointmen
kicyunya [14]

Troy should include a short overview of the story that his video will tell and why he wants to tell it (or what the video will be about and why). It should also include the target audience, and where the video will be published.

7 0
2 years ago
A method to accept the number of drawers in the desk as input from the key board. This method returns the number of drawers to t
Julli [10]

Answer:

Following code takes the information about the wood from the user, do the process of calculating the value according to there type and numbers, then add the surcharge to it while giving the answer to the user.

For differentiating the type of woof i used the if then else statement while i used switch case statement for assigning the appropriate value according to the types of the wood will be processing in the program.

The code is given below:

Explanation:

Code:

namespace std;\\ any name instead of std.

{

   class Program

   { \\ starting the main program

       static void Main(string[ ] args)

       {

           int numberOfDrawers = 0;

           string deskWoodType = "o";

           double cost = 0;

           drawersMeth(numberOfDrawers);

           woodTypeMeth(deskWoodType);

           CalculateCostMeth(numberOfDrawers, cost, deskWoodType);

           OutPutCostMeth(deskWoodType , cost, numberOfDrawers);

       }//end main

       private static void drawersMeth(int numberOfDrawers)

       {

           int numOfDrawers;

           Console.WriteLine("Enter the number of desk drawers");

           numOfDrawers = Convert.ToInt16(Console.ReadLine());

           numberOfDrawers = numOfDrawers;

       }//end drawersMeth

       private static string woodTypeMeth(string deskWoodType)

       {

           Console.WriteLine("Enter the desk wood type. (eg. type mahogany, oak, or pine)");

           deskWoodType = Convert.ToString(Console.ReadLine());

           switch (deskWoodType)

           {

               case "mahogany":

                   {

                       deskWoodType = "m";

                       break;

                   }

               case "oak":

                   {

                       deskWoodType = "o";

                       break;

                   }

               case "pine":

                   {

                       deskWoodType = "p";

                       break;

                   }

               default:

                   {

                       deskWoodType = "error";

                       break;

                   }

           }

           return deskWoodType;

       }// end woodTypeMeth

       private static int CalculateCostMeth(string deskWoodType, int numberOfDrawers, int cost)

       {

           int pine = 100;

           int oak = 140;

           int other = 180;

           int surchage = 30;

           if (deskWoodType == "p")

               cost = surchage + (numberOfDrawers *pine );

           else if (deskWoodType == "o")

               cost = surchage + (numberOfDrawers *oak );

           else

               cost = surchage + (numberOfDrawers *other );

           return cost;

       }// end CalculateCostMeth

       private static void OutPutCostMeth(int numberOfDrawers, string deskWoodType, int cost)

       {

           double totalCost = cost;

           Console.WriteLine("The number of drawers is {0}", numberOfDrawers);

           Console.WriteLine("The wood finish you have selected is ", deskWoodType);

           Console.WriteLine("The total cost is {0}", totalCost);

       }//end outputCost

   }//end class

}//end nameSpace

5 0
3 years ago
Please reply only in CORAL. I am not sure how to get the numbers between the negative version and positive version of the input
Veseljchak [2.6K]

Answer:

I have the solution.

Explanation:

Feel free to reach out. Thanks!

4 0
3 years ago
Other questions:
  • An ipv4 address in the range 169.254.0.1 through 169.254.255.254 indicates a problem with what type of service
    10·1 answer
  • A chef writing up her famed recipe for beef stew realizes she has switched parsley and oregano everywhere in the recipe. The che
    13·1 answer
  • Why is it important to protect people's intellectual property online?
    10·1 answer
  • Short Essay on the history of Computer​
    6·2 answers
  • List the gcc command-line options for each of the following: Generate a .o file rather than an executable. Generate a .s (assemb
    6·1 answer
  • . A collection of programs designed to create and manage databases is called a(n))
    13·1 answer
  • What provision of the Government Paperwork Elimination Act was designed to encourage a paperless society?
    6·2 answers
  • What are some options available in the Spelling and Grammar Checker? Check all that apply. Change and Change All Redo and Repeat
    15·2 answers
  • Why do you want to work from our company?​
    9·2 answers
  • The following is a function:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!