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
Katyanochek1 [597]
3 years ago
15

Using C++

Computers and Technology
1 answer:
sweet-ann [11.9K]3 years ago
6 0

Answer:

#include<iostream>

using namespace std;

void OutputMinutesAsHours(double origMinutes) { //Same as question

   double hours=origMinutes/60; //solution is here

   cout<<hours;

}

//Below is same as mentioned in question

int main() {

OutputMinutesAsHours(210.0);

cout << endl;

return 0;

}

OUTPUT :

3.5

Explanation:

In the above code, only two lines are added. To convert minutes into hours we have to divide them 60, so we take minutes as input and define a new variable of double type which stores minutes converted to hours and then that variable is printed to console. For 210, it gives 3.5, similarly for 3600 it gives 60 and so on.

You might be interested in
1. Separate valid and invalid variables:
DedPeter [7]

Firstly we explain the variable and the declaration rule for the variable and further separating the valid and invalid variables.

  • Whenever a user is given a question, variables are data values that can vary. for example  age, CSL, etc.
  • It may alter and during the execution of the program.
  • It's a storage space for memories.
  • It has a name that corresponds to the location.
  • Data is stored in the memory location.

The rule for variable declaration:

  • The names of your variables should be based on the phrases used in the subject area, and they should reflect the variable's function.
  • By removing spaces between the words, you can make variable names. Each word in the name should be capitalized, including prepositions and pronouns that are one letter long.
  • An underscore should never be used to start a variable name.
  • Single-character variable names should be avoided. For loop counters, only short variable names are permitted.
  • After the state that equals the "true" value, name variables that describe binary states ("true" or "false").

The valid variable is:

CSL, Age,CLS,SEE,Stop5for,Give, $shopping, and United.

The invalid variable is:

Mark-sheet, Tel $, Simple Interest, and 545Newton.

Learn more:

brainly.com/question/2684763

5 0
3 years ago
Create a program that allows the user to pick and enter a low and a high number. Your program should generate 10 random numbers
Natalka [10]

Answer:

import java.util.Scanner;

import java.util.Arrays;

import java.util.Random;

public class Main {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   System.out.print("Enter low: ");

   int low = scan.nextInt();

   System.out.print("Enter high: ");

   int high  = scan.nextInt();

   scan.close();

   int rndnumbers[] = new int[10];

   Random r = new Random();

   for(int i=0; i<rndnumbers.length; i++) {

     rndnumbers[i] = r.nextInt(high-low+1) + low;

   }

   for(int i=0; i<rndnumbers.length; i++) {

     System.out.printf("%d: %d\n", i, rndnumbers[i]);

   }

 }

}

4 0
2 years ago
Consider the following code segment: try : inputFile = open("lyrics.txt", "r") line = inputFile.readline() print(line) _________
aleksandrvk [35]

Answer:

The answer is "except IOError:"

Explanation:

It is part of the exception handling, that stands for input/ output operation fails, this exception aeries when we attempting to access an anti-existent file, in the program so, it will give the program related errors.

  • This type of error is handled in the try block, it also allows you to prepare the deal with the exceptional block.  
  • It also helps you to hide the bugs by using code, if you handle an unexpected error.
6 0
2 years ago
How could the following line of code be shortened?
Alinara [238K]

Answer:

2

Explanation:

The second option is the only one that will work. The last would work but doesn't make the code any shorter.

8 0
1 year ago
How did New York Governor Hugh Carey handle Sostre’s situation?
Ira Lisetskai [31]

Answer:

The governor found a way to free Sostre without assessing whether or not he was guilty or innocent of drug crime in buffalo.

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • Write a function called calculate() that accepts three integer Numbers as arguments, compute these values : Sum and Product and
    7·1 answer
  • Think about the five steps to writing an algorithm. Why is each step necessary? Why is it important to be precise when writing c
    15·1 answer
  • When you use a script to create all of the tables for a database, you must start with the tables that don't have _______________
    15·1 answer
  • PLEASE HELP ME ON THIS..............PLEASEEEEEEEEEEEE PLEASEEEEEE<br><br> ITTS EASYYYYYYYY
    12·1 answer
  • What is a help desk
    15·1 answer
  • By Carl Sandburg
    6·1 answer
  • Which small-group format would be most appropriate for the following situation? A large sporting event is coming to town. Key me
    14·2 answers
  • If we can lock a file, we can solve the race condition problem by locking a file during the check-and-use window, because no oth
    14·1 answer
  • Alexandria works for a non-profit company that asks for donations to help the homeless people in her community. Recently the dat
    12·1 answer
  • 11.6 Code Practice edhesive
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!