Ask the user for a filename that contains an unknown number of integers. Print the numbers one per line on the screen, then tell which one is the largest. Note: 1. I'm including a test file named "pract3.txt". Its largest value is 4999. 2. Make sure to test to see if the file actually opened. If not, print an error message and don't do anything else. If it did open, go ahead with the input, processing, and output. 3. Use the King of the Mountain technique for this program. 4. You will need to use a while loop that checks for when the end of the file is reached. 5. You can declare only two ints in this program. No other number variables are allowed.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Hi, I need to solve this problem with C++ programming language using Visual Studio. Thank you.

 

Prog3
Ask the user for a filename that contains an unknown number of integers. Print the numbers one per line
on the screen, then tell which one is the largest.
Note: 1. I'm including a test file named "pract3.txt". Its largest value is 4999.
2. Make sure to test to see if the file actually opened. If not, print an error message and don't
do anything else. If it did open, go ahead with the input, processing, and output.
3. Use the King of the Mountain technique for this program.
4. You will need to use a while loop that checks for when the end of the file is reached.
5. You can declare only two ints in this program. No other number variables are allowed.
Prog4
Ask the user for two points: (x1, y1) and (x2, y2). Notice that the input is coming from the keyboard.
Compute the slope and save the data into a file named "slope.txt" on the disk. The form in the file should
be:
Point 1 : (-3, 4)
Point 2 : (5, -2)
Slope
: -0.7500
Note: 1. The slope has 4 decimal places
2. The colons line up
3. The formula is: slope = 1
%3D
X2-X2
Transcribed Image Text:Prog3 Ask the user for a filename that contains an unknown number of integers. Print the numbers one per line on the screen, then tell which one is the largest. Note: 1. I'm including a test file named "pract3.txt". Its largest value is 4999. 2. Make sure to test to see if the file actually opened. If not, print an error message and don't do anything else. If it did open, go ahead with the input, processing, and output. 3. Use the King of the Mountain technique for this program. 4. You will need to use a while loop that checks for when the end of the file is reached. 5. You can declare only two ints in this program. No other number variables are allowed. Prog4 Ask the user for two points: (x1, y1) and (x2, y2). Notice that the input is coming from the keyboard. Compute the slope and save the data into a file named "slope.txt" on the disk. The form in the file should be: Point 1 : (-3, 4) Point 2 : (5, -2) Slope : -0.7500 Note: 1. The slope has 4 decimal places 2. The colons line up 3. The formula is: slope = 1 %3D X2-X2
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
Introduction to computer system
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT