please help create these c++ programs

October 29, 2010 at 16:44:59
Specs: Macintosh
Note: First, download surname_labx.cpp from Moodle. From now on, for every assignment, you will modify the downloaded .cpp file and only submit one file via Moodle. For each question, you will find spaces to fill in the cpp file. Be sure to change the name of the file accordingly before submitting. E.g., nergiz_lab2.cpp

1. Write a program that, when given two integers, prints out the fourth digit (from the right) of the sum of the numbers.
Examples:! 19834, 2100! -->! 1! ! ! 3456, 4567! -->! 8!
Output should look exactly like this:
>Please enter three integers: >2000 1045 >3
(21934) ( 8023)

2. Write a program that, when given three integers, prints out the minimum of the three. (You cannot use any math library) Examples:! 13, 21, 9! -->! 9
Output should look exactly like this:
>Please enter three integers: >35 56 24 >24

3. Write a program that, when given five integers, prints out the number of integers that are more than 0. Examples:! 13, 21, 9, -3, 5! -->! 4 ! ! 2, -4, 0, 435, 1! -->! 3
Output should look exactly like this:
>Please enter five integers: >35 56 200 -5 -6 >3


See More: please help create these c++ programs

Report •

#1
October 29, 2010 at 16:47:31
Awesome. When you get past the, "Have people on the Internet do my homework for free" stage, let us know.

If you start doing your homework yourself, but run into problems, feel free to ask us. Make sure to include the code you're having problems with.

If you prefer to have the Internet to do your homework, well, that's an option, too.

How To Ask Questions The Smart Way


Report •

#2
October 29, 2010 at 23:06:34
I apologize for this.I know that I should my homework myself,but I am new at c++ and I need big helps.
FOR EXAMPLE:for first program I wrote these one and I have problem at the middle of the program.How can I continue? Please help me...

#include<iostream>
using namespace std;

int main()
{
int num1,num2
cout<< "Please enter two integers:";
cout<<num1<<num2;
cin>>num1>>num2;

cout<<(num1+num2)<<endl;


Report •

#3
October 30, 2010 at 05:25:25
Well, you forgot a semicolon on the int num1,num2 line.
You don't close your int main() function, but that's probably a product of lazy copy/paste.
You output the values of your integers before you actually put anything in them, but that's just erroneous output and not a compile stopping bug.

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
November 14, 2010 at 08:20:34
#include <iostream.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>

int main()
{
long num1,num2, sum;
char strNum[40];
char ThirdDigit1;

//..................................
cout<< "Please enter two integers:";
cin >> num1 >> num2;
sum = num1 + num2;
//..................................
_ltoa(sum, strNum, 10);
//..................................
ThirdDigit1 = strNum[strlen(strNum) - 3];
//...................................
cout << endl << "(" << num1 << ")" << " (" << num2 << ")" << " sum = " << sum << " Third digit = " << ThirdDigit1;
//.........................................................
getch();
return 0;
}

...........................................................................................................

_Adnan_


Report •

#5
November 14, 2010 at 08:47:59
I apologize for this.I know that I should my homework myself,but I am new at c++ and I need big helps.

Most people studying programming at an academic institution usually have a tutor of some kind. These tutors gets paid for imparting their knowledge. Why not ask him/her and make them earn their money.

Stuart


Report •

#6
November 16, 2010 at 07:56:04
thank you very much :)

Report •

#7
November 16, 2010 at 08:06:27
You're welcome.

Report •

Ask Question