Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code has to be in c++ 1) Write a program that prints whether a char is number (0-9), a lowercase letter (a-z), a capital

image text in transcribed
The code has to be in c++
image text in transcribed
1) Write a program that prints whether a char is number (0-9), a lowercase letter (a-z), a capital letter (A-Z), or other (any other character). Use what we have learned about chars, explicit casting, if else statements, printing, and the ASCII table to do this. Provide a test suite along with the code you wrote as your answer. 2) For this question you can modify your answer to Lab 2.1 question 1. Write a program that takes in three inputs, The first is a numeric input, the next is char, the final is another numeric input. The second input must be char that is '+', ' or '/ if it is any other char it MUST be rejected. The second input is used as the operator and the first and third inputs as operands. The program will calculate the operator applied to the operands, print the result, then exit. As always, provide your source code and test suite for this question 3) Modify the program from above to give the user two attempts to enter input. If improper input is entered twice, the program needs to print out that there was an error and then exit (hint: review the code from the beginning of lab to get you started). Below! have given you some sample code do demonstrate a way to process user input of a float called leftOperand. Use this code to get started or augment your existing code with it. float leftOperand; cout > cin >> leftOperand; if (cin.fail()) { cin.clear(); cin.ignore(1000,"n") cout >", cin >> leftOperand, if (cin.fail()) { cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions