1.7 Lab Exercise 1a: Write an algorithm Before you write any code (in C++), you need to write the algorithm in English. The algorithm is the description of the problem and desired solution. It must include a list or description of the input (if there is any, such as something the user types), output (usually what will be printed onscreen, though it might be also written to a file), and the steps to create the output. For this exercise, add comments to the top of the program below, describing an algorithm for sorting a random stack of paper money, to increasing in value top to bottom. Each line of comment must begin with //. Ignore the code in the program below, but don't delete it. Be sure your comment algorithm includes the following lines, which should begin with the first word in each line below, and replace the underscore with your description of each item for this problem: // input: // output: // steps: ( The first is given for you below:) // 1. pick up a bill and determine its value // 2. 3. 403714.3402758.za/7 LAB ACTIVITY 1 //Type your algorithm here, as comments: 11 12 int main() // program to copy itself to screen 13 string s://holds a line of the file 14 15 362909 1.7.1: Lab Exercise 1a: Write an algorithm 6 // don't change the lines below. They are code to copy this entire file to the screen for testing... 7 #include 8 #include 9 #include 10 using namespace std; 16 17 18 ifstream ini("./main.cpp"); while (getline(in1.s)) etc... cout << s << endl; //copy line to screen return 0; main.cpp Load default template...

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

Need help and I am allowed to help. 

1.7 Lab Exercise 1a: Write an algorithm
Before you write any code (in C++), you need to write the algorithm in English. The algorithm is the description of the problem and desired
solution. It must include a list or description of the input (if there is any, such as something the user types), output (usually what will be
printed onscreen, though it might be also written to a file), and the steps to create the output.
For this exercise, add comments to the top of the program below, describing an algorithm for sorting a random stack of paper money, to
increasing in value top to bottom. Each line of comment must begin with //. Ignore the code in the program below, but don't delete it. Be
sure your comment algorithm includes the following lines, which should begin with the first word in each line below, and replace the
underscore with your description of each item for this problem:
// input:
// output:
// steps: ( The first is given for you below:)
1. pick up a bill and determine its value
2.
3.
403714.3402758.qx3zqy7
LAB
ACTIVITY
1.7.1: Lab Exercise 1a: Write an algorithm
11
12 int main() { // program to copy itself to screen
13
string s;
// holds a line of the file
14
ifstream in1("./main.cpp");
15
16
17
18
etc...
1 //Type your algorithm here, as comments:
2
3
4
5
6 // don't change the lines below. They are code to copy this entire file to the screen for testing...
7 #include <iostream>
8 #include <fstream>
9 #include <string>
10 using namespace std;
while (getline(in1.s))
cout << s << endl; //copy line to screen
return 0;
main.cpp
Load default template...
Transcribed Image Text:1.7 Lab Exercise 1a: Write an algorithm Before you write any code (in C++), you need to write the algorithm in English. The algorithm is the description of the problem and desired solution. It must include a list or description of the input (if there is any, such as something the user types), output (usually what will be printed onscreen, though it might be also written to a file), and the steps to create the output. For this exercise, add comments to the top of the program below, describing an algorithm for sorting a random stack of paper money, to increasing in value top to bottom. Each line of comment must begin with //. Ignore the code in the program below, but don't delete it. Be sure your comment algorithm includes the following lines, which should begin with the first word in each line below, and replace the underscore with your description of each item for this problem: // input: // output: // steps: ( The first is given for you below:) 1. pick up a bill and determine its value 2. 3. 403714.3402758.qx3zqy7 LAB ACTIVITY 1.7.1: Lab Exercise 1a: Write an algorithm 11 12 int main() { // program to copy itself to screen 13 string s; // holds a line of the file 14 ifstream in1("./main.cpp"); 15 16 17 18 etc... 1 //Type your algorithm here, as comments: 2 3 4 5 6 // don't change the lines below. They are code to copy this entire file to the screen for testing... 7 #include <iostream> 8 #include <fstream> 9 #include <string> 10 using namespace std; while (getline(in1.s)) cout << s << endl; //copy line to screen return 0; main.cpp Load default template...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Introduction to Template
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
  • SEE MORE 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