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
Nonamiya [84]
3 years ago
10

(Occurrence of max numbers) Write a program that reads integers, finds the largest of them, and counts its occurrences. Assume t

hat the input ends with number 0. Suppose that you entered 3 5 2 5 5 5 0; the program finds that the largest is 5 and the occurrence count for 5 is 4. Hint: Maintain two variables, max and count. max stores the current max number and count stores its occurrences. Initially, assign the first number to max and 1 to count. Compare each subsequent number with max. If the number is greater than max, assign it to max and reset count to 1. If the number is equal to max, increment count by 1. Sample Run 1 Enter an integer (0: for end of input): 3 Enter an integer (0: for end of input): 5 Enter an integer (0: for end of input): 2 Enter an integer (0: for end of input): 5 Enter an integer (0: for end of input): 5 Enter an integer (0: for end of input): 5 Enter an integer (0: for end of input): 0 The largest number is 5 The occurrence count of the largest number is 4 Sample Run 2 Enter an integer (0: for end of input): 0 No numbers are entered except 0 Class Name: Exercise05_41
Computers and Technology
1 answer:
tankabanditka [31]3 years ago
5 0

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main() //main method

{

int n=0,a[1000],c=0,val=10,ma=0;//defining integer variable

cin>>val;//input value

while(val!=0)//defining while loop that checks val is not equal to 0

{

a[n++]=val;//add value in array

cout<<"Enter an integer (0: for end of input):";//print message

cin>>val;//input value

}

for(int i=0;i<n;i++)//loop for finding the maximum in the array.

{

   ma=max(a[i],ma);//holding max value in ma variable

}

for(int i=0;i<n;i++)//loop for counting the occurence of maximum.

{

   if(a[i]==ma)//use if to check maximum value in array

   c++;//incrementing count value

}

cout<<"The maximum value is "<<ma<<" The count of maximum value is "<<c<<endl;//print result

return 0;

}

output:

Please find the attachment file.

Explanation:

In this code inside the main method, an integer variable is declared that input values and use while loop to check first input if the value is true it will accept value from the user and adds in the array.

In the next step, two for loop is declared that checks the max value and in the next loop it will count the number of maximum value which is occurring.

You might be interested in
What are two example of ways an electronic record may be distributed to others?
murzikaleks [220]
By email or publishing on the internet, I hope that helps!
4 0
3 years ago
Accessibility is the degree to which a product or service is readily available and usable by _____.
spayn [35]

Answer:

Accessibility in the sense considered here refers to the design of products, devices, services, vehicles, or environments so as to be usable by people with disabilities. The concept of accessible design and practice of accessible development ensures both "direct access" (i.e. unassisted) and "indirect access" meaning compatibility with a person's assistive technology (for example, computer screen readers).

Accessibility can be viewed as the "ability to access" and benefit from some system or entity. The concept focuses on enabling access for people with disabilities, or enabling access through the use of assistive technology; however, research and development in accessibility brings benefits to everyone.

Accessibility is not to be confused with usability, which is the extent to which a product (such as a device, service, or environment) can be used by specified users to achieve specified goals with effectiveness, efficiency, convenience satisfaction in a specified context of use.

Accessibility is strongly related to universal design which is the process of creating products that are usable by people with the widest possible range of abilities, operating within the widest possible range of situations. This is about making things accessible to all people (whether they have a disability or not).Explanation:

4 0
3 years ago
Which extensions can help drive installs of your mobile app?
Iteru [2.4K]

The question above has multiple choices as follows.

<span>a.       </span>App extensions 

<span>b.      </span>Sitelink extensions

<span>c.       </span>Structured snippet extensions 

<span>d.      </span>RSLAs (remarketing lists for search ads)

The correct answer is (A) App extensions 


App extensions are a great way for people to access your website. They allow you to link to your tablet or mobile app from your text adds. If you want to drive app downloads, app promo ads might be the best option.

5 0
3 years ago
What are the three primary separation of concerns on the client-side of a dynamic web application? (Check all that apply)
nlexa [21]

Answer:

Behaviour

Style

Structure

Explanation:

Above are the three primary separation of concerns for a web application at client side.

Structure --> we can define the structure of the application at client side using HTML

style-->style is used to give some styling information like font,color,headings so on at client side .In general we use CSS to do this at client side

Behaviour--> it actually defines the functionality of the elements at client side like when we click button what it should do.We will use JavaScript to define the behaviours at client side

7 0
3 years ago
What is &lt;html&gt;
ipn [44]

the opening tag for an HTML document

8 0
3 years ago
Read 2 more answers
Other questions:
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • Objective:This assignment is designed to give you experience with thinking about algorithm analysis and performanceevaluation.Pr
    11·1 answer
  • You are tasked with creating a mileage calculator to calculate the amount of money that should be paid to employees. The mileage
    5·1 answer
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • Lexi wants to buy a $300 painting. when she gets to the store, she finds that it is on sale for 40% off. how much does Lexi spen
    10·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • - Which amongst the following is not a Characteristic of Cloud Computing?
    5·1 answer
  • What is your impression on the subject fundamentals of database systems?​
    7·1 answer
  • In cell b12 create a formula using max f7nction to calculate maximum value in B4:B9
    7·1 answer
  • What do you mean by computer ethics?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!