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

Task 1 (Calculator) Use three different prompts to have the user input the infor

ID: 3749153 • Letter: T

Question

Task 1 (Calculator)

Use three different prompts to have the user input the information. After the information is inputted in, display the 2 numbers and the operator the user has chosen then what that process equals. Example: "2+2=4" .You should have variables for the firstNumber, secondNumber, result, and operator. The user cannot input a letter at all in any input Users can only input numbers where numbers should go, as well as only operators where operators go. If the user were to input the wrong type of information in the prompt, let the user know they inputted the wrong type of information

Task 2 (Login Screen)

Create two input tags, one for username and the other for password. I should be able to distinguish between the two. Create a submission button. This login only takes "masteradmin" as the username and "masterpassword" as the password. When I successfully login, an alert should appear saying "Login Successful" . When I fail the login, an alert should appear saying "Failed # times" with # being the number of times the user has failed.

Task 3 (Rock Paper Sciccors)

Create three buttons in html that the user interacts with, one for rock, paper, and scissors. When the user clicks, the program should randomly generate a guess for the computer opponent. In your HTML, it should display what you and the computer chose, then determine who is the winner and display that as well . After the winner is chosen, the player should be able to play again

Explanation / Answer

------------------------------------------------------------------------
/*Task 1 (Calculator)

Use three different prompts to have the user input the information.
After the information is inputted in, display the 2 numbers and the
operator the user has chosen then what that process equals. Example: "2+2=4" .
You should have variables for the firstNumber, secondNumber, result, and operator.
The user cannot input a letter at all in any input Users can only input numbers where numbers should go,
as well as only operators where operators go. If the user were to input the wrong type of information in the prompt,
let the user know they inputted the wrong type of information*/

#include <iostream>
using namespace std;
int main() {
//Declaring 2 integer variables
int first,second;
char Operator;
//displaying output over screen
cout << "Enter the first integer: ";
//cin >> boardLength;
while ( !(cin>>first))
{
cout << "Not valid input. Try again" << endl;
cout << "Enter the first integer: ";
cin.clear();
cin.ignore(1000, ' ');
}

cout<<" ";
//displaying output over screen
cout << "Enter the second integer: ";
while ( !(cin>>second))
{
cout << "Not valid input. Try again" << endl;
cout << "Enter the second integer: ";
cin.clear();
cin.ignore(1000, ' ');
}
cout << "Enter Operator which you want to Perform(+,-,%,/,*): ";
cin>>Operator;
if(Operator=='+'){
cout<<first<<" + "<<second<<" = "<<first+second<<endl;
}
else if(Operator=='*'){
cout<<first<<" * "<<second<<" = "<<first*second<<endl;
}
else if(Operator=='/'){
cout<<first<<" / "<<second<<" = "<<first/second<<endl;
}
else if(Operator=='%'){
cout<<first<<" % "<<second<<" = "<<first%second<<endl;
}
else if(Operator=='-'){
cout<<first<<" - "<<second<<" = "<<first%second<<endl;
}
else{
cout<<"You have entered invalid oprator. Ending program"<<endl;
}

}
------------------------------------------------------------------------------

/*Task 2 (Login Screen)

Create two input tags, one for username and the other for password. I should be able to distinguish between the two.
Create a submission button. This login only takes "masteradmin" as the username and "masterpassword" as the password.
When I successfully login, an alert should appear saying "Login Successful" .
When I fail the login, an alert should appear saying "Failed # times" with # being the number of times the user has failed.*/

#include <iostream>
using namespace std;
int main() {
string username;
string password;
int count=0;
int BoolUser=0;
while(BoolUser==0){
cout << "Please enter user name: ";
cin>>username;
cout<<"Please enter password to login: ";
cin>>password;
if(password == "masterpassword" && username =="masteradmin"){
cout<<"Login Successfull";
BoolUser=1;
}
else{
count=count+1;
cout<<"Failed "<<count<<" times ";
}
}
}

---------------------------------------------------------------------------------------
Task 3 (Rock Paper Sciccors)

/*Create three buttons in html that the user interacts with, one for rock, paper, and scissors.
When the user clicks, the program should randomly generate a guess for the computer opponent.
In your HTML, it should display what you and the computer chose, then determine who is the winner and display that as well .
After the winner is chosen, the player should be able to play again*/


<html>

<head>

<script>

playRoshambo = function(Gesture){


if (Gesture=='rock') {

result = "tie";

}

if (Gesture=='paper') {

result = "win";

}  

if (Gesture=='scissors') {

result = "lose";

}   

alert("You " + result + "!");

}

</script>

</head>

<body>

<p>Which one will it be?</p>

<a href="#">rock</a>

<a href="#">paper</a>

<a href="#">scissors</a>

</body>

</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote