Project #41309 - C++

 

Q1)

File input: strings and numbers

Ask the user for a file name. Open the named file, and read in two strings and an integer.  Close the file and print the two string variables and one integer variable to the screen. 

File name: test.txt 

Note:  There will be a hidden test that will read from a different file having the exact same format, but with different content, from the included file.

Sample Output:

What is the name of the file?
test.txt
The name is: Back To The Future
The age is: 1984
The snack is: The Karate Kid


-----------------------------------------------------------------------------------------------------
Q2)

Create a program that asks the user to enter in two numbers.  Pass the two numbers as arguments to a function.  If the sum of the numbers is greater than 10, the function returns true. Otherwise the function returns false.

This is the prototype for the function:

bool sumthemup(int first, int second);

 

Sample output #1:

Enter in two integers

6

8

The sum is greater than 10

Sample output #2:

Enter in two numbers

2

3

The sum is less or equal to 10

Subject Computer
Due By (Pacific Time) 09/26/2014 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy