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
vodomira [7]
3 years ago
4

Write a program that accepts three decimal numbers as input and outputs their sum.

Computers and Technology
2 answers:
liraira [26]3 years ago
3 0

Answer:

C++ code

Explanation:

C++ code

#include <iostream>

#include <cstdlib>

using namespace std;

int main(){

double first,second,third;

cout<<"Enter first Decimal :";

cin>>first;

cout<<"Enter second Decimal :";

cin>>second;

cout<<"Enter third Decimal :";

cin>>third;

 

cout<<"Sum of three decimal = "<<first+second+third;

 

return 0;

 

}

Code Explanation

Decimal numbers are stored in double data types.

So first declare three variables and then get input by using cin from command line.

At the end display there sum by addition of all three variables.

Output

Enter first Decimal :10.22

Enter second Decimal :20.22

Enter third Decimal :9.99

Sum of three decimal = 40.43

kumpel [21]3 years ago
3 0

Answer:

i = 0

total = []

print('Enter 3 decimal numbers')

while i < 3:

   num = float(input(str(i+1)+')'))

   i += 1

   total.append(num)

print('sum = ',sum(total))

Explanation:

The programming language used is python.

The code prompts the user to Enter three decimal numbers, accepts the numbers and then outputs the sum.

A WHILE loop is used to collect the three numbers and the numbers are stored in a list using the append method. finally we make use of the list attribute sum, to evaluate the sum of the three numbers inputted.

A picture is attached  for you to see how the code behaves.

You might be interested in
3. Find the product of (a² +3a+5) x (a+7)​
sergij07 [2.7K]

Explanation:

(a^2 + 3a +5) × (a + 7)

= a^3 + 7a^2 + 3a^2 + 21a + 5a + 35

= a^3 + 10a^2 + 26a + 35

3 0
4 years ago
Fiscal policy includes each of the following except? 1) the money supply. 2) taxes. 3) government spending. 4) the automatic sta
Rasek [7]

The fiscal policy directs the usage of government spending and tax policies to exploit economic conditions, especially macroeconomic circumstances. Fiscal policy includes each of the money supply.

<h3>What does the fiscal policy include?</h3>

The fiscal policy directs the usage of government spending and tax policies to exploit economic conditions, especially macroeconomic circumstances. These contain aggregate demand for goods and benefits, employment, inflation, and economic growth.

Some of the key goals of fiscal policy exist as economic stability, price stability, full employment, optimum allocation of resources, accelerating the rate of economic development, encouraging investment, and capital formation and growth.

Fiscal policy exists as measures employed by governments to stabilize the economy, especially by exploiting the levels and distributions of taxes and government expenditures. Fiscal measures exist frequently utilized in tandem with economic policy to attain specific objectives.

Large-scale underemployment, lack of coordination from the public, tax evasion, and low tax base are the other constraints of fiscal policy.

Therefore, the correct answer is option 1) the money supply.

To learn more about fiscal policy refer to:

brainly.com/question/6583917

#SPJ4

7 0
1 year ago
A thesis statement is the last sentence of the conclusion. It summarizes the entire paper.
emmasim [6.3K]
False. A thesis statement usually introduces the topics or ideas you are going to write about, so this means that it is at the end of the FIRST paragraph.
7 0
2 years ago
suspect that several users are attempting to install unauthorized software. Upon researching, you discover that the attempts wer
pochemuha
Two factor authentication? I’m not sure
3 0
3 years ago
After class a student asked why you would ever use a heap instead of a binary search tree. Provide a good explanation for why an
sertanlavr [38]

Answer:

Heap is useful when you want to find max/min element in the given list

BinarySearchTree is used if you need sorted elements of the list

Explanation:

Heap is Good at finding Min/Max and it's time complexity is  (O(1)), while BST is good at all finds (O(logN)). Insert is O(logN) for Heap and BSTstructures..

Max Heap ensures that elements on higher levels are greater than elements at lower level

MinHeap ensures that elements on higher levels are lesser than elements at lower level

BST gives sorted elements by following order (left,root,right).If we want sorted elements we can go with BST

5 0
3 years ago
Other questions:
  • Which group on the Home Ribbon allows you to add shapes to a PowerPoint slide?
    10·2 answers
  • What do you think is the most fascinating aspect of the internet?
    14·1 answer
  • When the print server processes documents waiting in the queue until the print device is available to accept the print job is ca
    14·1 answer
  • You notice that it’s very easy to confuse medications at the community health center where you’re working. They are lined up on
    10·1 answer
  • The first thing you must consider in any type of communication is ______.
    9·2 answers
  • In Online Data Extraction data is extracteddirectly from the ------ system itself.o Hosto Destinationo Sourceo Terminal
    15·1 answer
  • Write a function that, given an array A of N integers, of which represents loads caused by successive processes, the function sh
    15·1 answer
  • A printer is displaying no images on its LED panel. What can a technician do to troubleshoot the situation? Choose two answers.
    6·1 answer
  • an IPv6 packet has a 40 byte base header, a 20 byte destination options extension header (which is not used for routing) and 200
    5·1 answer
  • Suppose a computer's login mechanism first asks for a user name, and then for the password, regardless of whether or not the log
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!