please help me with this one

Write a c++ program that accepts three card values as inputs and calculates the total value of the hand and display the value of the three cards.

How would I start such?

here is an example:


1
2
3
4
5
//how to take input and print that
int aNumber;
std::cout << "Enter a number" << std::endl; //this will print this string
std::cin >> aNumber; //this will put the user entered number in this variable
std::cout << "You entered" << aNumber << std::endl;



1
2
3
//how to add two number's
//take two number as input like the previous one
int addition = Numberone + Numbertwo; //these are added, now print addition 

# include<iostream>

using namespace std;

int main ()

{
int card1,card2, card3;

cout<<"Enter the value of the first card: ";
cin>>card1;
cout<<"Enter the value of the second card: ";
cin>>card2;
cout<<"Enter the value of the third card: ";
cin>>card3;
cout<<"Your score is: ";

if (card1==1 && card2==1);

else if (card1==1)
cout<<11+ card1 + card2;

else if (card2==1)
cout<<card1+ 11 + card3;

else if (card3==1)
cout<<card1+ card2+ 11;


return 0;
}


is this correct?
Topic archived. No new replies allowed.