Write a C++ program in this new file. Hint: you can use helloworld.cpp as a template. In this new file, write a program that does the following: 1. Accepts 10 integers from the user using an array and a loop. The user will type the input on the console. 2. Prints the numbers entered by the user in reverse order from the order in which they were entered. This output is displayed on the console. 3. Sorts the contents of the array from lowest to highest number and displays the numbers in this new, sorted order.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a C++ program in this new file. Hint: you can use helloworld.cpp as a template. In this new file,
write a program that does the following:
1.
Accepts 10 integers from the user using an array and a loop. The user will type the
input on the console.
2.
Prints the numbers entered by the user in reverse order from the order in which they
were entered. This output is displayed on the console.
3.
Sorts the contents of the array from lowest to highest number and displays the
numbers in this new, sorted order.
o Note: You are allowed to use any existing sorting algorithm. However, you are NOT allowed to use a
library implementation of the algorithm. You must implement the algorithm from scratch.
Two simple algorithms that could be used for this task are Bubble Sort e (url:
https://en.wikipedia.org/wiki/Bubble sort e ) and Insertion Sort e (url:
https://en.wikipedia.org/wiki/lInsertion sort -). You may implement either one or choose
another one if you prefer.
Make sure to compile and test your program to be certain it works as expected. If you aren't sure
how to compile and run a C++ program, refer to Slides 20 & 21 of the Cloud9SetUpSlides e .
When your program is complete, refer to Slide 23 of the Cloud9SetUpSlides e to see how to
download the arrayLoops.cpp file and upload the file to this quiz question.
Transcribed Image Text:Write a C++ program in this new file. Hint: you can use helloworld.cpp as a template. In this new file, write a program that does the following: 1. Accepts 10 integers from the user using an array and a loop. The user will type the input on the console. 2. Prints the numbers entered by the user in reverse order from the order in which they were entered. This output is displayed on the console. 3. Sorts the contents of the array from lowest to highest number and displays the numbers in this new, sorted order. o Note: You are allowed to use any existing sorting algorithm. However, you are NOT allowed to use a library implementation of the algorithm. You must implement the algorithm from scratch. Two simple algorithms that could be used for this task are Bubble Sort e (url: https://en.wikipedia.org/wiki/Bubble sort e ) and Insertion Sort e (url: https://en.wikipedia.org/wiki/lInsertion sort -). You may implement either one or choose another one if you prefer. Make sure to compile and test your program to be certain it works as expected. If you aren't sure how to compile and run a C++ program, refer to Slides 20 & 21 of the Cloud9SetUpSlides e . When your program is complete, refer to Slide 23 of the Cloud9SetUpSlides e to see how to download the arrayLoops.cpp file and upload the file to this quiz question.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education