1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
4 years ago
4

Write a program that prompts the user to input an integer between 0 and 35. The prompt should say Enter an integer between 0 and

35:. If the number is less than or equal to 9, the program should output the number; otherwise, it should output: A for 10 B for 11 C for 12 . . . and Z for 35. (Hint: For numbers >= 10, calculate the ASCII value for the corresponding letter and convert it to a char using the cast operator, static_cast().)
Computers and Technology
1 answer:
Troyanec [42]4 years ago
7 0

Answer:

The code for answer this written in C++ is given below:

#include <iostream>

int main() {

 int number;

 std::cout << "Enter an integer between 0 and 35 \n";

 std::cin >> number;

 if(number >= 0 && number < 10){

   std::cout << "The ASCII is: " << number << "\n";

 }else if(number >= 10 && number <= 35){

   std::cout << "The ASCI is: " << static_cast<char>(number + 55) << "\n";

 }else{

   std::cout << "Enter a number between 0 and 35!";

 }

}

Explanation:

The explanation of each line in the code is given below:

#include <iostream> //<em>The library for use input and output flow, </em>cout - cin.

int main() { //<em>Start the logic of the program</em>

 int number; // <em>Declare a variable which is going to store the input of the user.</em>

 std::cout << "Enter an integer between 0 and 35 \n";

/* Show in the console the message to request a number between 0 and 35*/

 std::cin >> number;

/* Store the input of the user in the number variable.*/

 if(number >= 0 && number < 10){

//If the number is between 0 and 10 print the number.

   std::cout << "The ASCII is: " << number << "\n";

 }else if(number >= 10 && number <= 35){

/*If the number is between 10 and 35 convert to ASCII, add 55 to the number because the letters in ASCII representation starts in 65*/

   std::cout << "The ASCI is: " << static_cast<char>(number + 55) << "\n";

 }else{

/*If the number is not between 0 and 35 display an error message*/

   std::cout << "Enter a number between 0 and 35!";

 }

}

You might be interested in
Which payment method typically charges the highest interest rates
mixer [17]
Credit cards do charge the most interest
5 0
3 years ago
You work in an office that uses Linux servers and Windows servers. The network uses both the TCP/IP protocol. The Linux server i
kap26 [50]

Answer:

The answer is "ifconfig".

Explanation:

The ifconfig. me is indeed a website that shows basic network packets, like IP address, hostname, user agent string. It provides a simple interface that may be queried with the assistance of the command prompt to obtain the required information. The whole function provides the essential information about a certain program's interface.

5 0
3 years ago
Is it possible to build something that doesn't exist yet?
Anastasy [175]

Answer:

yes

Explanation:

how do u think other thing were built like when phones were first made

5 0
3 years ago
____ is an act of malicious destruction to a computer or computer resource.
PtichkaEL [24]
The answer is going to be computer sabotage
7 0
3 years ago
Which of the following lines of distribution best describes the diagram?
SashulF [63]
A) retail distribution.
5 0
3 years ago
Read 2 more answers
Other questions:
  • WILL GIVE BRAINLIEST PLEASE HELP / urgent
    9·1 answer
  • The source ip address is 164.109.28.3 subnet mask of 255.255.128.0 network address is
    7·1 answer
  • _____ is a feature that records the changes you make to a document.
    12·1 answer
  • ♡ Another Dum Question But Oh Wells -.- ♡
    12·2 answers
  • What company or individual is responsible for developing the linux operating system?
    7·1 answer
  • What is infinite recursion?
    7·1 answer
  • In the world of computing, _________ means acquiring or exchanging copies of protected digital creations without payment or perm
    12·1 answer
  • Two methods defined within a class are shown below. What can be said about the variable x used in both methods?
    10·1 answer
  • In online advertising, the term "impression" refers to: the Web site displayed when a user clicks on an advertisement. the measu
    11·1 answer
  • Write two statements that each use malloc to allocate an int location for each pointer. Sample output for given program:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!