Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am in an intro programming class and do not know how to code at all. Below is

ID: 3884846 • Letter: I

Question

I am in an intro programming class and do not know how to code at all. Below is a program I am supposed to do but do not know how to, I am using Atom as my text editor ad Windows Powershell as my compiler. He wants it done how the pictures suggest. COuld you please explain step by step how to do this (pictures would be great) it would be even better if you could explain it in a way that teaches me as well. Thank you so much

program is to show how to do basic things in a language. Your job is to take the given code, modify it to output 4 different messages. The idea is the output isn't terribly hard or important, I want you to practice the command line commands and practice compiling on the command line. These two skills will be extremely important throughout the entirety of the course and so we want to work on them early. #include iostream» using std::cout; using std: endl; int main) cout

Explanation / Answer

As you are completely new to programming , let's start from the begining.

The language used above is known as c++ and its a very popular language.

Now this exercise only emphasises on the ways you can print stuff to the screen. As it is shown in the above example code "cout << " is used to print data to the screen. Now the instructor wants you to print data out in different formats on the screen.

In part One of the problem , he wants you to print a name inside a box sort of shape you draw.

Now when thinking about how to do this , is that you need not change anycode outside main function and only need to modify the code inside the main.

So the way to solve the problem in part one is ,

first you need top of the box as remember that the printing on the screen is only done is top down fashion.

So that may look something like

cout << "+-----------------------------+"<<endl;

The thing inside the double quotes is the test that is going to be printed and the endl is to produce a new line after this making sure that cursor moves to next line.

So , the final solution may look like ,

cout << "+-----------------------------+"<<endl;

cout << "| ADAM |" << endl;

cout << "+-----------------------------+"<<endl;

Get the idea , now problem 2 and 3 are of the similar spirit.

But the problem 4 introduces a new concept of something called as an escape sequence and its just a fancy way of saying that ' ' is equal to enter key on my keyboard.

These are reserved seq. for specific things , so if you want to print on the screen , it will be a problem as the computer / compiler will take it as the enter key and won't print the desired output.

Now to resolve this problem we use and extra backslash to prevent this behaviour and the above can be achieved by doing cout << " ";

output:-

So this will help you do problem4.