Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is C++ I have gotten this far but i need my program to do this your program should ask the user how many numbers

this is C++ I have gotten this far but i need my program to do this

your program should ask the user how many numbers of type double are in the list, and then get the specified number of doubles. After all the doubles are read, the program should display the largest of the numbers entered.

can someone explain the piece i am missing to find the largest number from the values enter

#include using namespace std; int main() { int typeDoubles; cout << "Enter number of double values:" << endl; cin >> typeDoubles; double *arr = new double[typeDoubles]; cout << "Enter double values:" << endl; for (int i = 0; i < typeDoubles; i++) cin >> arr[i]; double total = 0; for (int i = 0; i < typeDoubles; i++) total += arr[i]; //cout << total / numDoubles << endl; delete [] arr; //system("pause"); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

What is P{T1 Answered: 1 week ago

Answered: 1 week ago