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
Your company requires computers to authenticate to one another and enforces this requirement with Windows Defender Firewall with
lubasha [3.4K]

There are a lot of rules in computing. The above can be done with authentication exemption.

<h3>What is Authentication exemptions?</h3>

This is a method that helps one to be able to specify a particular group of computers.

Conclusively, This can be done via their Active Directory computer account name or the use of their IP address. Tis does not apply to existing connection security rules.

Learn more about   authentication exemption from

brainly.com/question/25739714

7 0
3 years ago
Which technology can be implemented as part of an authentication system to verify the identification of employees?
STALIN [3.7K]
The answer is smart card readers. Smart card readers can be implemented as part of an authentication system to verify the identification of employees.
5 0
2 years ago
In the following scenario, which is the least
mario62 [17]

Answer:

Size

Explanation:

Connectivity, they need internet to work.

Speed, they need it to work fast.

Storage, they need space to work.

Size, isn't all that important, unlike the rest.

7 0
3 years ago
Each time the ENTER key is pressed, Word creates a new paragraph. T/F
Sergio [31]
When you hit enter key you will create new paragraph so answer is true
4 0
3 years ago
Which methods can you use to migrate user settings from windows 8.1 to windows 10?
seropon [69]

Windows Easy Transfer is used  to migrate user settings from windows 8.1 to windows 10,.

<h3>What is Windows Easy Transfer?</h3>

Windows Easy Transfer exists as a specialized file transfer program developed by Microsoft that permits users of the Windows operating system to transfer personal files and locations from a computer running an earlier version of Windows to a computer running a newer version.

The Windows Easy Transfer utility can be utilized to back up data from a computer before completing an upgrade or clean install of the Windows 8 operating system and then restore the data to the computer after the Windows 8 operating system exists installed.

Hence, Use Windows Easy Transfer. Copy the user profile from the old computer to the new computer. Complete an upgrade over the top of the old operating system. utilize the User State Migration Toolkit.

To learn more about Windows Easy Transfer refer to:

https://brainly.in/question/2787534

#SPJ4

7 0
2 years ago
Other questions:
  • Describe the concepts of confidentiality, integrity, and availability (C-I-A), and explain each of the seven domains of a typica
    9·1 answer
  • In controlling network traffic to minimize slow-downs, a technology called ________ is used to examine data files and sort low-p
    15·1 answer
  • Desktop computer systems are less reliable than laptop computers. <br> a. True <br> b. False
    9·1 answer
  • We will pass in 2 values, X and Y. You should calculate XY XY and output only the final result. You will probably know that XY X
    13·1 answer
  • Retrieve the names of employees who work on exactly one project that is controlled by their department. (It does not matter how
    7·1 answer
  • Explain the developments RAM since it was created in 1968 til today.
    7·1 answer
  • Adam's interview with the hiring manager is going well. However, he wants to ensure that his skills and work history are memorab
    6·1 answer
  • The term phreaker is now commonly associated with an individual who cracks or removes software protection that is designed to pr
    13·2 answers
  • Write a program that allows the user to enter their name from the keyboard. Allow the user to pick how many times they want thei
    12·1 answer
  • Select the correct answer.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!