Question: I've got code below for this exercise. But it is not working, there might be something missing or it is wrong. #include main(){ num_values =

 I've got code below for this exercise. But it is not

I've got code below for this exercise. But it is not working, there might be something missing or it is wrong.

#include

main(){

num_values = int(input("Enter a number: "))

values = []

for i in range(num_values):

value = float(input("Enter a floating point value: "))

values.append(value)

print("The sum of the values is:", sum(values))}

Lab 07 - Exercise 2. Write a program that asks the user for a number (integer) and then will read in from the user the same number of floating point values. When the user has entered the correct number of values, output the sum of those values. Example. User enters 3. Then enters 3 floating point numbers 3.4,4.7,2.4 The program will output - 10.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!