Starting from:

$25

OOP- Assignment #1 Solved

Problem 1
Describe, in your own words, (1) what does #include <iostream> does for our programs and (2) why is might be better idea not write using namespace std - and use other alternatives for our programs

Problem 2
Describe at least 2 forms of input and output and explain which of C++’s streams are used to support them.

Problem 3
During our class we ended up with a buggy implementation of a program which was supposed to read two numbers from a file and display it on the screen. We encountered 2 “bugs” in our program, the first one is demonstrated in the buggy_extra_value.cpp. The second one is demonstrated in buggy_same_value.cpp, as we saw, instead of all the values in a file it only prints - infinitely - the last one.

Please explain what’s exactly wrong with each program and submit fixed versions as extra_value_fixed.cpp and same_value_fixed.cpp files.

Problem 4
Write a program that gets 5 strings from a user(e.i “my string”, “foo 2 baz”) and writes them in a file called user_input.txt. Put your solution in user_input.cpp file.

Problem 5
Use loop and a half paradigm to read, line by line instead of word by word, content

read_text.txt and display it on the console. Put your solution into read_file.txt

More products