Concept explainers
Following variables are used in the program:
TotalJobMinutes: To the total job minutes value.
Hours: To store the number of hours.
Minutes: To store the number of minutes
Following functions are used in the program:
WriteLine(): To display the hours and minutes value for given total job minutes.
ReadKey(): To end the program after reading a random variable.
Summary Introduction:
Program will use Main() in which value of total minutes involved in a job is stored in variable TotalJobMinutes. Using this value of TotalJobMinutes, number of hours and minutes in it are calculated as quotient and remainder obtained on dividing it by 60 respectively. The value of hours and minutes is then displayed to user using WriteLine() method.
Program Description:
Purpose of the program is to represent the total minutes involved in a job in hours and minutes format.
Trending nowThis is a popular solution!
Chapter 2 Solutions
Microsoft Visual C#
- Write a program named Eggs that declares four variables to hold the number of eggs produced in a month by each of four chickens, and assign a value to each variable. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.arrow_forwardWrite a program that declares a variable named inches as an input, which holds alength in inches. Display the value in feet and inches; for example, 86 inchesbecomes 7 feet and 2 inches. Save the program as InchesToFeet.java.arrow_forwardWrite a program that declares a variable named inches, which holds a length in inches, and assign a value. Display the value in feet and inches; for example: 86 inches is 7 feet and 2 inches. Be sure to use a named constant where appropriate. When submitting the program for testing/grading, assign the value 86 to inches.arrow_forward
- Write a program that allows the user to set the loan amount, loan period, and interest rate, and displays the corresponding interest, principal, andbalance in the currency format.arrow_forwardIn visual basic programming, write a button click even that will take a given amount in cedis and exchange rate and calculate the equivalence in US dollars when the user chooses "Yes", returns the cedi valuewhen the user chooses "No" and Zero when the user chooses "Cancel".arrow_forwardFollow the code below for completion. At the end, what value is contained within the variable x? int y= 10; int z= 2; double x= (double) y/z;arrow_forward
- Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average.arrow_forwardWrite a program that declares a named constant to hold the number of quarts in a gallon (4). Also declare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. Compute and display the number of gallons and quarts needed for the job. Display explanatory text with the values—for example, A job that needs 18 quarts requires 4 gallons plus 2 quarts. Save the program as QuartsToGallons.java. Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the number of quarts, accept the value from the user as input. Save the revised program as QuartsToGallonsInteractive.java.arrow_forwardCreate a program that prompts the user for an amount less than 100 and then displays the minimum number of coins necessary to make the change. The change can be made up of quarters, dimes, nickles, and penniesarrow_forward
- 4. Step through each line of the JavaScript program below. (This is the program from Figure 17.1.) Write down the value of each variable as you walk through it. Use an order of a 16 oz. latte with 2 shot. var price; var taxRate = 0.088; if (drink == "espresso") price = 1.40; if (drink == "latte" || drink == "cappuccino") { if (ounce == 8) price = 1.95; if (ounce == 12) price = 2.35; if (ounce == 16) price = 2.75; } if (drink == "Americano") price = 1.20 + .30 * (ounce/8); price = price + (shots - 1) * .50; price = price + price * taxRatearrow_forwardWrite a program named Eggs that declares four variables of type int to hold the number of eggs produced in a month by each of four chickens, and assign a value to each variable. Call these variables chicken1, chicken2, etc. Sum the eggs, then display the total in dozens and eggs. For example, if the total number of eggs was 95, the output would be 95 eggs is 7 dozen and 11 eggs. Note: For final submission ensure that the total number eggs equals 127.arrow_forwardWrite an application that asks a user to enter an integer. Display a statement that indicates whether the integer is even or odd.arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT