Need a screenshot of a basic program...

I'm taking a class on programming with C++ but I've been having A LOT of trouble installing the necessary software to do my homework and practice problems. That's a problem that I need to figure out on my own. What I desperately need help with right now is getting screenshots of some basic programs to show for credit. (The teacher will only accept screenshots, even if it's correctly written in Word she'll give no credit.) If anyone could rewrite my programs and send me some screenshots, I'd REALLY appreciate it. Hopefully this is the only time I'll ever need to do this. And there might be a couple mistakes, so it'd be awesome to get an edit in the process.

Let me know if you're interested and I'll post the questions and my answers--there's only two and they're pretty short.
Highlight the program you want a screen shot of, type Alt-Printscreen on your keyboard and open paint and paste.
Let me see em
Highlight the program you want a screen shot of, type Alt-Printscreen on your keyboard and open paint and paste.


@op

Aside from this obviously perfect answer, why didn't you just Google that?
If I take a screenshot from paint, there are no noticeable differences? Here's what I have:

6. Write a program to print the following pattern.
*****
***
* * *

// Quiz 1, Problem 6
#include <stdio.h>

// function main begins program execution
int main ( void )
{
printf( “*****\n ***\n* * *\n” );
}

7. Write a program that prompts the user to enter two integer values on two different lines and then displays the sum, difference, product, quotient and modulus of the two integers.

// Quiz 1, Problem 7
#include <stdio.h>

// Function main begins program execution
int main ( void )
{
int integer1; // first number to be entered by user
int integer2; // second numer to be entered by user
int sum; // variable in which sum will be stored
int difference; // variable in which difference will be stored
int product; // variable in which product will be stored
int quotient; // variable in which quotient will be stored
int modulus; // variable in which modulus will be stored

printf ( “Enter first integer.\n” ); // prompt
scanf ( “%d”, &integer1 ); // read an integer

printf ( “Enter second integer.\nDo not enter zero.\n” ); // prompt
scanf ( “%d”\ &integer2 ); // read an integer

if ( integer1 == 0 ) {
printf ( “I told you not to enter zero.\n” );
} // end if

else {
sum = integer1 + integer2; // assign total to sum
difference = integer1 – integer2; // assign total to difference
product = integer1 * integer2; // assign total to product
quotient = integer1 / integer2; // assign total to quotient
modulus = integer1 % integer2; // assign total to modulus

printf ( “Sum is %d.\nDifference is %d.\nProduct is %d.\nQuotient is %d.\nModulus is %d.\n”, sum, difference, product, quotient, modulus ); // print values
} // end else
} // end function main
@Oria

I've never done ANY programming before, so I'm feeling pretty lost. This is only like the second week of class and I'm not sure what the screenshot would even look like. Also, Google has been giving me pretty different/contradicting answers for a lot of my programming problems. While I'm here, I might as well ask this as well:

What command do you have to type in the command prompt of a computer with a Linux OS to get the list of all the sub-directories contained in the current directory? Which command do you have to type if you are using Windows OS?

That's another question I found many different, unclear answers to.
Last edited on
Well first thing i can point out to you is that if you are trying to learn C++ then you shouldnt use C code. printf and scanf are C, replace printf with cout and scanf with cin. so this

1
2
printf ( “Enter first integer.\n” ); // prompt
scanf ( “%d”, &integer1 ); // read an integer 


would be this in C++

1
2
cout << "Enter first integer" << endl; // prompt
cin >> integer1; // read an integer 
Last edited on
@Oria

I've never done ANY programming before, so I'm feeling pretty lost. This is only like the second week of class and I'm not sure what the screenshot would even look like. Also, Google has been giving me pretty different/contradicting answers for a lot of my programming problems. While I'm here, I might as well ask this as well:


Your teacher ask to take a screenshot. which is something that you should know before you start learning programing, IMO. But regardless, the first answer was good in the regard that you hit a key on your keyboard then paste the image in a simple drawing program.

If you Google "how to take a screenshot" you will get this:
http://www.java.com/en/download/faq/screenshot.xml

if not on Windows, search "how to take a screenshot with ..... "
Last edited on
Rocket Power wrote:
What command do you have to type in the command prompt of a computer with a Linux OS to get the list of all the sub-directories contained in the current directory? Which command do you have to type if you are using Windows OS?


Unix:
ls -l   <-- Lists files and directories
ls -d */ <-- Lists just the directories


Windows:
dir <-- List files and directories
dir /ad <-- Lists just the directories


In Unix, use man on a command to see the options.
e.g.
man ls


In Windows, use /?
e.g.
dir/?
Last edited on
Topic archived. No new replies allowed.