Question: 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


Question 4. [20 marks] Write a program which keeps reading positive numbers 

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

1 Expert Approved Answer
Step: 1 Unlock

The C program that meets the specified requirements include include include include using namespace ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!