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
VLD [36.1K]
3 years ago
13

(Complete the Problem-Solving discussion in Word for Programming Challenge 2 on page 404. Your Problem-Solving discussion should

include Problem Statement, Problem Analysis, Program Design, Program Code and Program Test in Words Document.) Create a program that will find and display the largest of a list of positive numbers entered by the user. The user should indicate that he/she has finished entering numbers by entering a 0.
Computers and Technology
1 answer:
zimovet [89]3 years ago
6 0

Answer:

The approach to the question and appropriate comments are given below in C++

Explanation:

Problem statement:

Write a program that will find and display the largest of a list of positive numbers entered by the user. The user should indicate that he/she has finished entering numbers by entering a 0.

Problem Analysis:

It can be completed in worst-case O(n) complexity, best case O(1) (if the first number is maxed element)

Program Design:

1. Start

2. Take the list of positive numbers for the user until he/she enter 0.

3. store the entered numbers in an array

4. find the max number from it.

5. Print the output

6. End

Program Code:

#include<iostream>

using namespace std;

int main(){

  int num = 0, *array = NULL, i= 0, counter = 0, max = 0;

 

  cout<<"Enter a list of positive numbers to find the maximum out of it and if you enter 0 that is the last number: \n";

  array = new int;

 

  /*Taking input from user until he/she enters 0*/

  while(1){

      cin>>num;

      array[i] = num;

      i++;counter++;

      if(num == 0)

          break;  

  }

 

  cout<<"Print user input numbers: \n";

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

      cout<<"list["<<i<<"] --> "<<array[i]<<"\n";

  cout<<"\n";

 

  /*Find max element*/

  max = array[0];

  for(int i=0;i<counter;i++){

      if(array[i] > max)

          max = array[i];  

  }

  cout<<"Max number = "<<max<<"\n";      

  delete array;  

  return 0;

}

You might be interested in
When should students practice netiquette in an online course? Check all that apply.
Elden [556K]

Answer:

tienesrazon  

Explanation:

6 0
3 years ago
Which of the following is a reason to use storyboarding? (Select all that apply)
fomenos

Answer:

To have all your ideas in one place

To conceptualize design ideas

To present ideas to a client

Explanation:

A storyboard refera to a graphic organizer which consists of images which are displayed in sequence in order to pre-visualise an animation, motion picture, etc.

It is important as it conveys how a story will flow, and also help in conceptualizing design ideas. Based on the options given, the correct options are:

• To have all your ideas in one place

• To conceptualize design ideas

• To present ideas to a client

3 0
3 years ago
A standard computer monitor is 1024 pixels wide and 768 pixels tall
Annette [7]
If this is a true or false question the answer is true
8 0
4 years ago
SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
kap26 [50]

Answer:Answer:

TRUE

Explanation:

SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater the effect) because one of the factors that affects availability in a satellites is rain. Higher frequencies in Ka-band (30/20 GHz), rain can have a very large effect that simply cannot be overcome at the usual levels of availability.

Rain reduces the quality of signals by interfering with the signals thereby, reducing their strength and quality.

Therefore Rain can not only degrade a satellite's signal, it can also cause a complete outage of the satellite's.

4 0
4 years ago
How many wins does ninja have :/
den301095 [7]

Answer:

he played 13,500 games and has 37 percent win rate

5 0
3 years ago
Other questions:
  • What career is likely to have to highest salary
    14·2 answers
  • Write a C++ function, lastLargestIndex that takes as parameters an int array and its size and returns the index of the last occu
    10·1 answer
  • You are building a gaming computer and you want to install a dedicated graphics card that has a fast GPU and 1GB of memory onboa
    6·1 answer
  • Write a python function c that converts bitstring array back to an integer numpy array
    5·1 answer
  • Discuss the infrastructure necessary for the Internet of Things and Cloud computing to exist. What unique services does this ena
    7·1 answer
  • Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
    7·2 answers
  • X333: countElements Given an array of integers and an integer target, return a count of the number of times the target value occ
    6·1 answer
  • Let G = (V, E) be an undirected graph. Design algorithms for the following (in each
    6·1 answer
  • PLEASE HELP!!<br> Would you ever try and get famous off of social media? Why or why not?
    6·2 answers
  • What enforces the location in which an app can function by tracking the location of the mobile device?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!