subject

Write a program that counts the number of negative values, the number of positive values and the number of zeros in a floating point array. instead of performing these counts inside the main program, each count should be calculated by a user-defined function.

specificially, the program should:

• greet the user,

• prompt for and input the length of the array;

• idiotproof the array length;

• dynamically allocate the array;

• check that the allocation was successful;

• prompt for and input the values in the array

• count the number of negative values by calling a user-defined function;

• count the number of positive values by calling a user-defined function;

• count the number of zeros by calling a user-defined function;

• output the numbers of negative, positive and zero values in the array;

• deallocate the array.

note: you must calculate each of the three counts in its own user-defined function; you are absolutely forbidden to calculate more than one of them in the same user-defined function.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
You know the right answer?
Write a program that counts the number of negative values, the number of positive values and the num...
Questions
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Physics, 18.09.2020 19:01
question
Biology, 18.09.2020 19:01
question
Mathematics, 18.09.2020 20:01
question
Biology, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
English, 18.09.2020 20:01
question
Health, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
English, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
Chemistry, 18.09.2020 20:01
question
Biology, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
question
Mathematics, 18.09.2020 20:01
Questions on the website: 13722367