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
Masja [62]
3 years ago
14

Given that two int variables, total and amount, have been declared, write a sequence of statements that: initializes total to 0

reads three values into amount, one at a time. After each value is read in to amount, it is added to the value in total (that is, total is incremented by the value in amount). Instructor Notes: Do not use any looping. Just use three cin statements and three calculations.
Computers and Technology
1 answer:
artcher [175]3 years ago
6 0

Answer:

Following are the program in C++ language :

#include <iostream> // header file

using namespace std; // using namespace

int main() // main method

{

   int amount,total=0; // two int variable declaration

   cout<<" enter amount:";

   cin>>amount; // read input amount first time

   total=total+amount; // first calculation

   cout<<" enter amount:";

   cin>>amount; //read input amount second time

   total=total+amount;// second calculation

   cout<<" enter amount:";

   cin>>amount;// read input amount third time

   total=total+amount;// third calculation

   cout<<"total:"<<total; // display total

  return 0;

}

Output:

enter amount:12

enter amount:12

enter amount:12

total:36

Explanation:

Following are the explanation of program which is mention above

  • Declared the two variable total and amount of int type .
  • Initialize the variable total to "0".
  • Read the 3 input in "amount" variable in one by one by using cin function and adding their value to the "total "variable .
  • Finally display the total.
You might be interested in
Complete the following Programming Assignment using Recursion. Use good programming style and all the concepts previously covere
Likurg_2 [28]

Answer:

Explanation:

public class Ackermann {

   public static int ackermann's(int m, int n) {

       if (m == 0) {

           return n + 1;

       } else if (n == 0) {

           return ackermann's(m-1, 1);

       } else {

           return ackermann(m - 1, ackermann(m, n - 1));

       }

   }

   public static void main(String[] args) {

       System.out.println(ackermann(0, 0));

       System.out.println(ackermann(0, 1));

       System.out.println(ackermann(1, 1));

       System.out.println(ackermann(1, 2));

       System.out.println(ackermann(1, 3));

       System.out.println(ackermann(2, 2));

       System.out.println(ackermann(3, 2));

   }

}

1

2

3

4

5

6

7

29

Process finished with exit code 0

6 0
3 years ago
A. True
vlada-n [284]
True <span>when an input file is opened, the read position is initially set to the first item in the file.</span>
8 0
3 years ago
Describe the data update difference between operational and analytical data.
crimeas [40]

Operational data is used to sustain applications that help facilitate operations.

These databases are directed to as application-oriented. Analytical data is used to examine one or more business areas, such as sales, costs, or profit

<h3>What is the distinction between operational and information-analytical systems?</h3>

Operational systems are prepared to deal with the running values of data. Informational Systems deal with the collection, collection, and deriving of information from data.

<h3>What is the distinction between operational and analytical reporting?</h3>

Analytical reporting is introduced toward supporting the strategic and preparing functions of senior management.

Functional reporting is oriented toward helping the day-to-day organizational functions.

To learn more about Operational data, refer

brainly.com/question/22670650

#SPJ4

7 0
1 year ago
Create a simple JavaScript calculator.
Gre4nikov [31]

Answer: edit out anything you dont need

<!DOCTYPE html>  

<html lang = "en">  

<head>  

<title> JavaScript Calculator </title>  

 

<style>  

h1 {  

   text-align: center;  

   padding: 23px;  

   background-color: skyblue;  

   color: white;  

   }  

 

#clear{  

width: 270px;  

border: 3px solid gray;  

   border-radius: 3px;  

   padding: 20px;  

   background-color: red;  

}  

 

.formstyle  

{  

width: 300px;  

height: 530px;  

margin: auto;  

border: 3px solid skyblue;  

border-radius: 5px;  

padding: 20px;  

}  

 

 

 

input  

{  

width: 20px;  

background-color: green;  

color: white;  

border: 3px solid gray;  

   border-radius: 5px;  

   padding: 26px;  

   margin: 5px;  

   font-size: 15px;  

}  

 

 

#calc{  

width: 250px;  

border: 5px solid black;  

   border-radius: 3px;  

   padding: 20px;  

   margin: auto;  

}  

 

</style>  

 

</head>  

<body>  

<h1> Calculator Program in JavaScript </h1>  

<div class= "formstyle">  

<form name = "form1">  

     

   <!-- This input box shows the button pressed by the user in calculator. -->  

 <input id = "calc" type ="text" name = "answer"> <br> <br>  

 <!-- Display the calculator button on the screen. -->  

 <!-- onclick() function display the number prsses by the user. -->  

 <input type = "button" value = "1" onclick = "form1.answer.value += '1' ">  

 <input type = "button" value = "2" onclick = "form1.answer.value += '2' ">  

 <input type = "button" value = "3" onclick = "form1.answer.value += '3' ">  

  <input type = "button" value = "+" onclick = "form1.answer.value += '+' ">  

 <br> <br>  

   

 <input type = "button" value = "4" onclick = "form1.answer.value += '4' ">  

 <input type = "button" value = "5" onclick = "form1.answer.value += '5' ">  

 <input type = "button" value = "6" onclick = "form1.answer.value += '6' ">  

 <input type = "button" value = "-" onclick = "form1.answer.value += '-' ">  

 <br> <br>  

   

 <input type = "button" value = "7" onclick = "form1.answer.value += '7' ">  

 <input type = "button" value = "8" onclick = "form1.answer.value += '8' ">  

 <input type = "button" value = "9" onclick = "form1.answer.value += '9' ">  

 <input type = "button" value = "*" onclick = "form1.answer.value += '*' ">  

 <br> <br>  

   

   

 <input type = "button" value = "/" onclick = "form1.answer.value += '/' ">  

 <input type = "button" value = "0" onclick = "form1.answer.value += '0' ">  

   <input type = "button" value = "." onclick = "form1.answer.value += '.' ">  

   <!-- When we click on the '=' button, the onclick() shows the sum results on the calculator screen. -->  

 <input type = "button" value = "=" onclick = "form1.answer.value = eval(form1.answer.value) ">  

 <br>  

 <!-- Display the Cancel button and erase all data entered by the user. -->  

 <input type = "button" value = "Clear All" onclick = "form1.answer.value = ' ' " id= "clear" >  

 <br>  

   

</form>  

</div>  

</body>  

</html>  

Explanation:

3 0
2 years ago
A program is required to three (3) numbers. calculate and print their total
podryga [215]

A program that is required to three (3) numbers. calculate and print their total is given below:

<h3>The Program</h3>

import java.util.Scanner;

public class SumAndAverage {

public static void main(String[ ] args) {

System.out.println("Enter three numbers - ");

// Accepting and finding sum of numbers.

int sum = 0;

Scanner sc = new Scanner(System.in);

for (int i = 0; i < 3; i++)

sum += sc.nextInt( );

// Printing sum and average.

System.out.println("Sum - " + sum);

System.out.println("Average - " + (sum / 3f));

}

}

The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total


Read more about programming here:

brainly.com/question/23275071

#SPJ1

5 0
1 year ago
Other questions:
  • Look at the four schematic symbols shown in the figure above. Each of the symbols is labeled with a number. Which of the followi
    5·2 answers
  • What is the definition of framerate?
    7·1 answer
  • Changing the configuration of a database falls under which category of databaseâ administration?
    15·1 answer
  • What is cyber stalking and how does it work?
    7·2 answers
  • Should organizations fear websites where consumers post negative messages about products or services? What actions can companies
    12·1 answer
  • A 1000 elements array is used to store integers ascending order . The array is used to search binary search algorithm for the in
    14·1 answer
  • How can you employ one of the most powerful interactive business tools on the Internet today?
    11·1 answer
  • Deleting anitem from a linked list is best when performed using two pointersso that the deleted item is freed from memory.
    7·1 answer
  • Write the two features of a mouse.​
    9·1 answer
  • When must an Assured Equipment Grounding Conductor Program (AEGCP) be in place?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!