Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Include include using namespace std; Question 4. [20 marks] Write a program which keeps reading positive numbers until the input is 0 (ignored). No

C++

Include

include

using namespace std;

Question 4. [20 marks] Write a program which keeps reading positive numbers until the input is 0 (ignored). No error checking is needed. No more than 100 numbers will be entered. Print the input numbers with the tenth-place sorted in ascending order. For numbers having the same tenth-place, sort the numbers in descending order. Integers should be printed with no decimal places. Non-integers should be printed in 2 decimal places. Example 1: (user input is underlined) 123456.0 123.456 321.654 76543210 0 Sorted: 76543210 321.65 123.46 123456 Example 2: (user input is underlined) 111 222 11111 22222 0 Sorted: 11111 111 22222 222


student submitted image, transcription available below 

Question 4. [20 marks] Write a program which keeps reading positive numbers until the input is 0 (ignored). No error checking is needed. No more than 100 numbers will be entered. Example 1: (user input is underlined) 123456.0 123.456 321.654 76543210 0 Sorted: 76543210 321.65 123.46 123456 Print the input numbers with the tenth-place sorted in ascending order. For numbers having the same tenth-place, sort the numbers in descending order. Integers should be printed with no decimal places. Non-integers should be printed in 2 decimal places. Example 2: (user input is underlined) 111 222 11111 22222 0 Sorted: 11111 111 22222 222

Step by Step Solution

There are 3 Steps involved in it

Step: 1

The C program that meets the specified requirements include include include include using namespace ... 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

Auditing and Assurance services an integrated approach

Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley

14th Edition

133081605, 132575957, 9780133081602, 978-0132575959

More Books

Students also viewed these Programming questions

Question

5. How is Karen Slagles argument an example of confirmation bias?

Answered: 1 week ago