Question

Using basic c++ write a separate code for each question. 1. Palindrome if else • Try...

Using basic c++ write a separate code for each question.

1. Palindrome if else • Try to find if a 5 digit input number is a palindrome • Get one 5 digit number from user • Output: Enter a five-digit integer: 12345 12345 is not a palindrome Enter a five-digit integer: 34543 34543 is a palindrome

2. WiFi Diagonostics using multiple ifs PRINT: This program will help you diagnose a bad WiFi connection. 1 st level Check the below (Use string1== “string2”) method PRINT: Perform this action: Reboot the computer and try to connect. PRINT: Did that fix the problem? (Enter yes or no) If yes come out of the loop and print Glad the problem is fixed. Have a good day!“. If no 2nd level Check the below PRINT: Perform this action: Reboot the router and try to connect."); PRINT: did that fix the problem? (Enter yes or no): If yes come out and print Glad the problem is fixed. Have a good day!“. If no 3rd level Check the below PRINT: Perform this action: Make sure the cables between the router and modem are plugged in firmly. PRINT: Did that fix the problem? (Enter yes or no): If yes come out and print Glad the problem is fixed. Have a good day!“. If no 4 th level Check the below PRINT: Perform this action: Move the router to a new location.; PRINT: Did that fix the problem? (Enter yes or no): If yes come out and print Glad the problem is fixed. Have a good day!“. If no PRINT: Get a new router.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE 1:

#include <iostream>

using namespace std;

int main()
{
int a,no,b,temp=0;
cout<<"Enter any num: ";
cin>>no;
b=no;
for(;no>0;)
{
a=no%10;
no=no/10;
temp=temp*10+a;
}
if(temp==b)
{
cout<<"Palindrome";
}
else
{
cout<<"not Palindrome";
}
}

Output:

CODE 2:


#include <iostream>
#include<string.h>
using namespace std;

int main()
{
string s;
cout<<"This program will help you diagnose a bad WiFi connection. ";
cout<<"Perform this action: Reboot the computer and try to connect. Did that fix the problem? (Enter yes or no) : ";
cin>>s;
if(s=="yes"){
cout<<"Glad the problem is fixed. Have a good day!";
}
else if(s=="no"){
cout<<"Perform this action: Reboot the router and try to connect. Did that fix the problem? (Enter yes or no) : ";

cin>>s;
  
if(s=="yes"){
cout<<"Glad the problem is fixed. Have a good day!";
}
else if(s=="no"){
cout<<"Perform this action: Make sure the cables between the router and modem are plugged in firmly. Did that fix the problem? (Enter yes or no): ";

cin>>s;
  
if(s=="yes"){
cout<<"Glad the problem is fixed. Have a good day!";
}
else if(s=="no"){
cout<<"Perform this action: Move the router to a new location. Did that fix the problem? (Enter yes or no): ";

cin>>s;
if(s=="yes"){
cout<<"Glad the problem is fixed. Have a good day!";
}
else if(s=="no"){
cout<<"Get a new router";
  
}
else{
cout<<"Invalid Option";
}
  
}
else{
cout<<"Invalid Option";
}
  
  
  
}
else{
cout<<"Invalid Option";
}
  
}
else{
cout<<"Invalid Option";
}
}

Output:

*Feel free to ask(comment) if you have any doubts or if you face any difficulties while executing the program, I will be happy to help you, please upvote if you like the solution

Add a comment
Know the answer?
Add Answer to:
Using basic c++ write a separate code for each question. 1. Palindrome if else • Try...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need help completing the following 2 programs using PyCharm. Any help is appreciated. Language is Python....

    Need help completing the following 2 programs using PyCharm. Any help is appreciated. Language is Python. Task: Complete the two programs in Python and submit the source code here for grading. Program 1:  Sort Three Numbers(50 points): Design a program that asks user to enter any three integer numbers. The program should display the three numbers in descending order. Program 2: WiFi Diagnostic Tree(50 points): Download the attached file, follow the instruction, and complete and submit the code here for grading....

  • Using C programming language Question 1 a) through m) Exercise #1: Write a C program that...

    Using C programming language Question 1 a) through m) Exercise #1: Write a C program that contains the following steps (make sure all variables are int). Read carefully each step as they are not only programming steps but also learning topics that explain how functions in C really work. a. Ask the user for a number between 10 and 99. Write an input validation loop to make sure it is within the prescribed range and ask again if not. b....

  • This interactive program focuses on if/else statements, Scanner, and returning values. Turn in a file named...

    This interactive program focuses on if/else statements, Scanner, and returning values. Turn in a file named Budgeter.java. To use a Scanner for console input, you must import java.util.*; in your code. This program prompts a person for income and expense amounts, then calculates their net monthly income. Below are two example logs of execution from the program. This program’s behavior is dependent on the user input (user input is bold and underlined below to make it stand out and differentiate...

  • Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin...

    Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin at the University of Washington, Seattle, who originally wrote this assignment (for their CSE 142, in Java) This program focuses on classes and objects. Turn in two files named Birthday.cs and Date.cs. You will also need the support file Date.dll; it is contained in the starter project for this assignment. The assignment has two parts: a client program that uses Date objects, and a...

  • Please write a BASH Script in LINUX that... 1. is actually executable 2. has a comment...

    Please write a BASH Script in LINUX that... 1. is actually executable 2. has a comment to tell us what you did, why and how. 3. allows a user to enter their name and a number between 1 than 100 (this must be prompted so the user knows what to do) 4. creates a random number between 1 and 100 for you to guess. The command to create a random number is shown below. (if you find a better one...use...

  • Infix Expression Evaluator For this project, write a C program that will evaluate an infix expression. The algorithm REQ...

    Infix Expression Evaluator For this project, write a C program that will evaluate an infix expression. The algorithm REQUIRED for this program will use two stacks, an operator stack and a value stack. Both stacks MUST be implemented using a linked list. For this program, you are to write functions for the linked list stacks with the following names: int isEmpty (stack); void push (stack, data); data top (stack); void pop (stack); // return TRUE if the stack has no...

  • Infix Expression Evaluator For this project, write a C program that will evaluate an infix expression. The algorithm REQ...

    Infix Expression Evaluator For this project, write a C program that will evaluate an infix expression. The algorithm REQUIRED for this program will use two stacks, an operator stack and a value stack. Both stacks MUST be implemented using a linked list. For this program, you are to write functions for the linked list stacks with the following names: int isEmpty (stack); void push (stack, data); data top (stack); void pop (stack); // return TRUE if the stack has no...

  • i have the case study question with the answers but i need help to re-write the...

    i have the case study question with the answers but i need help to re-write the answers. please see the attached files Case Study Analysis (CSF3003) Assessment Description and Requirements CLO1: Case Study 1 Ahmad lef home to study master and PhD in Australia. He has fees for the first semester only. After he arrived to Sydney and settled down, he start looking for a part-time job to save money for the next term. Ahmad has some experience on making...

  • Additional code needed: PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an...

    Additional code needed: PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an order at a fast-food burger joint. This class will be used in Part B, when we work with a list of orders. As vou work through this part and Part B, draw a UML diagram of each class in using the UML drawing tool 1) Create a new Lab5TestProject project in Netbeans, right-click on the lab5testproject package and select New>Java Class 2) Call your...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT