Write code in MinutesToHours that assigns totalHours with totalMins divided by 60

Given the following code:

Function MinutesToHours(float totalMins) returns float totalHours
totalHours = MinutesToHours(totalMins / 60)
// Calculate totalHours:
totalHours = 0

Function Main() returns nothing
float userMins
float totalHours

userMins = Get next input
totalHours = MinutesToHours(userMins)

Put userMins to output
Put " minutes are " to output
Put totalHours to output
Put " hours." to output

Answers

Answer 1

Answer:

Function MinutesToHours(float totalMins) returns float totalHours

   // Calculate totalHours:

   totalHours = totalMins / 60

   return totalHours

End Function


Related Questions

he files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.

An example of the program is shown below:

Enter a number between 1 and 20 >> 5
5 4 3 2 1 Blastoff!
JAVA CODE:
// Prompt user for value to start
// Value must be between 1 and 20 inclusive
// At command line, count down to blastoff
// With a brief pause between each displayed value
import java.util.Scanner;
public class DebugSix3
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int userNum, val;
final int MIN = 1;
final int MAX = 20;
final int TIME_WASTER = 100000;
System.out.print("Enter a number between " + MIN +
" and " + MAX + " >> ");
userNum = keyboard.nextInt();
while(userNum < MIN && userNum < MAX)
{
System.out.println("Number out of range");
System.out.print("Enter a number between " + MIN + " and " +
MAX + " inclusive >> ");
userNum = keyboard.nextInt();
}
for(val = userNum; val == 0; --val)
{
System.out.print(val + " ");
for(int x = 0; x < TIME_WASTER; ++x)
for(int y = 0; y < TIMEWASTER; ++y)
for(int z = 0; z < TIME_WASTER;);
// Adjust these numbers for faster or slower performance
}
System.out.println("Blastoff!");
}
}

Answers

Fixed code:

import java.util.Scanner;

public class DebugSix3 {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int userNum, val;
final int MIN = 1;
final int MAX = 20;
final int TIME_WASTER = 100000;

Kotlin:
System.out.print("Enter a number between " + MIN + " and " + MAX + " >> ");
userNum = keyboard.nextInt();

while (userNum < MIN || userNum > MAX) {
System.out.println("Number out of range");
System.out.print("Enter a number between " + MIN + " and " + MAX + " inclusive >> ");
userNum = keyboard.nextInt();
}

for (val = userNum; val >= 0; --val) {
System.out.print(val + " ");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Blastoff!");
}

Changes made:

Fixed the while loop condition to use OR instead of AND
Fixed the for loop condition to use greater than or equal to instead of equal to
Added a try-catch block to pause the loop for 1 second using Thread.sleep() instead of nested for loops
Fixed some syntax errors and indentation issues.

program to take the command line input to cut down the blast off.

// DebugSix3.java

// Prompt user for value to start

// Value must be between 1 and 20 inclusive

// At command line, count down to blastoff

// With a brief pause between each displayed value

import javax.swing.*;

public class DebugSix3

{

 public static void main(String[] args)

 {

   String userNumString;

   int userNum, val;

   final int MIN = 1;

   final int MAX = 20;

   userNumString = JOptionPane.showInputDialog(null,

       "Enter a number between " + MIN + " and " + MAX + " inclusive");

   userNum = Integer.parseInt(userNumString);

   while(userNum < MIN || userNum > MAX)

   {

      userNumString = JOptionPane.showInputDialog(null,

       "Number out of range" +

       "\nEnter a number between " + MIN + " and " + MAX + " inclusive");

      userNum = Integer.parseInt(userNumString);

   }

   for(val = userNum; val > 0; --val)

   {

     System.out.print(val + "  ");

     for(int x = 0; x < 100000; ++x)

      for(int y = 0; y < 10000; ++y);

      // Adjust these numbers for faster or slower performance

   }

   System.out.println("Blastoff!");

 }

}

learn more about command line input here:

https://brainly.com/question/19569210

#SPJ1

10 Enter the reference to the total estimated cost in the appropriate location for the second data table. Apply a custom number format to display Total Sq Ft in that cell. Apply Blue font and bold to that cell. How to?

Answers

Answer:

Explanation:

To enter the reference to the total estimated cost in the appropriate location for the second data table and apply a custom number format to display Total Sq Ft in that cell, and apply Blue font and bold to that cell, you can follow the steps below:

Select the cell where you want to display the Total Sq Ft.

In the formula bar, type the formula "=SUM(D2:D10)" (assuming the data range is D2:D10). This will calculate the total square footage of the listed properties.

Press Enter to apply the formula and display the Total Sq Ft value in the selected cell.

With the cell still selected, go to the Home tab in the Ribbon and click on the Font Color dropdown arrow.

Choose the blue color from the color palette to apply the blue font color to the cell.

With the cell still selected, press the keys "Ctrl+B" or click on the Bold button in the Ribbon to apply bold formatting to the cell.

To apply a custom number format to the cell, right-click on the cell and select "Format Cells" from the context menu.

In the Format Cells dialog box, go to the Number tab and select "Custom" from the Category list.

In the Type field, type the following custom number format: "#,##0 Sq Ft"

Click OK to apply the custom number format to the cell.

Now the cell should display the Total Sq Ft in blue font and bold formatting with the custom number format applied.

Other Questions
for a second order reaction with an initial concentration of reactant of 64 m, what concentration of the reactant is left after three half lives? h. pylori infection is rare and causes peptic ulcers in the vast majority of those infected true false Opposition to the Mexican - American War referred to it as A- The Democrat's WarB- Mr Madison's WarC- Mr Polk's WarD- Mr Taylor's War Can y answer this question please in which number does the digit 3 have a value that is 10 times as great as the value of the digit 3 in 143,728 in the time period of 1860 - 1900, lumber entrepreneurs could purchase land in michigan from the government land office for: there are 20 rows of seats on a concert hall: 25 seats are in the 1st row, 27 seats on the 2nd row, 29 seats on the 3rd row, and so on. if the price per ticket is $2,300, how much will be the total sales for a one-night concert if all seats are taken? What is the definition of a parable? Describe some of the main themes taught in the parables of Christianity. Randi is applying for a job at a tech start-up. She has been told that it is a pretty casual workplace. Should she still dress professionally for her interview? A. No, if it is a causal workplace, jeans and a t-shirt are probably fine. B. Yes, but only if the employer tells her to when she sets up the interview. C. No, what a potential employee wears to an interview really does not matter. D. Yes, employees should demonstrate their understanding of professional standards. The table below shows a set of points that have been dilated. The rule for the dilation is (x, y).(x, y)(0, 1)(4,-2)(-6,1)TrueFalsePrevious(0,1)(2,-1)(-3,2)O A local store charges $1.97 per pound for bananas and $4.49 for a gallon of apple juice what is the cost of 1.5 lb of bananas and 1 gallon of apple juice a group of observations measured at successive time intervals is known as a(n) . a. additive time series model b. forecast c. time series Which structure in the fetus allows blood to be shunted from the right atrium to the left atrium the natural rate of unemployment (nru) occurs when elimination tool select one answer a the number of job seekers is greater than the number of job vacancies. b the number of job seekers is equal to the number of job vacancies. c the number of job seekers is less than the number of job vacancies. d frictional unemployment is no more than 2%. Need help its due tomorrow for test corrections!! building envelope, sometimes also called thermal envelope or building enclosure, controls the flows of between the interior and exterior of the building? how do the oral histories in source 5 add to your understanding of home front involvement in the war effort? does their testimony force you to question the other documents in any way, and if so, how? PLX SIMPLIFY -2.6+3.9b which statements accurately explain the deontology system of ethics? select all that apply. one, some, or all responses may be correct. graphy = -6 4x + y = 2 a 0.30 m solution of sucrose (c12h22o11) at 37oc has approximately the same osmotic pressure as blood. what is the osmotic pressure of blood?