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
AnnyKZ [126]
3 years ago
11

Write pseudocode for a function that translates a telephone number with letters in it (such as 1-800-FLOWERS) into the actual ph

one number. Use the standard letters on a phone pad.
Computers and Technology
1 answer:
TiliK225 [7]3 years ago
7 0

Answer:

Explanation:

Function telToNumbers with one parameter of a String input for the telephoneNumber

String var newTelephoneNum;

for loop through telephoneNumber {

Char var currentChar = current Character in the loop;

currentChar to lower Case;

Switch statement (currentChar) {

 case "a" or "b" or "c" : newTelephoneNum += "2"; break;

 case "d" or "e" or "f" : newTelephoneNum += "3"; break;

 case "g" or "h" or "i" : newTelephoneNum += "4"; break;

 case "j" or "k" or "l" : newTelephoneNum += "5"; break;

 case "m" or "n" or "o" : newTelephoneNum += "6"; break;

 case "p" or "q" or "r" or "s" : newTelephoneNum += "7"; break;

 case "t" or "u" or "v" : newTelephoneNum += "8"; break;

 case "w" or "x" or "y" or "z" : newTelephoneNum += "9"; break;

 default : newTelephoneNum += currentChar; break;

 }

}

print newTelephoneNum;

You might be interested in
Define Technology. Explain the term.​
aleksandrvk [35]

Answer:

Technology refers to methods, systems, and devices which are the result of scientific knowledge being used for practical purposes. Technology is changing fast. They should be allowed to wait for cheaper technologies to be developed.

7 0
3 years ago
Read 2 more answers
What is the primary purpose of EHRs?
Solnce55 [7]

Answer:

It is important to note that the primary purpose of EHRs is to support and improve individual patient care. As such the EHR is created and held according to professional and legal obligations of confidentiality

Explanation:

8 0
3 years ago
If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s
mars1129 [50]

Answer:

def calculate_storage(filesize):

   block_size = 4096

   full_blocks = filesize // block_size

   partial_block = filesize % block_size

   if partial_block > 0:

       return (full_blocks + 1) * block_size

   return filesize

print(calculate_storage(1))

print(calculate_storage(4096))

print(calculate_storage(4097))

Explanation:

The python program defines the function 'calculate_storage' that calculates the block storage used. It gets the number of blocks used to store the data by making a floor division to get the integer value, then it checks for remaining spaces in the block. If there are spaces left, it adds one to the full_blocks variable and returns the result of the multiplication of the full_blocks and block_size variables.

8 0
3 years ago
mystery_int_1 = 3 mystery_int_2 = 4 mystery_int_3 = 5 You may modify the lines of code above, but don't move them! Above are thr
hodyreva [135]

Answer:

The solution code is written in Python

  1. import random
  2. mystery_int_1 = 3  
  3. mystery_int_2 = 4  
  4. mystery_int_3 = 5
  5. print(str(mystery_int_1) + " " + str(mystery_int_2) + " " + str(mystery_int_3))
  6. while(mystery_int_1 > 0 or mystery_int_2 > 0 or mystery_int_3 > 0 ):
  7.    mystery_int_1 = random.randint(-5, 5)  
  8.    mystery_int_2 = random.randint(-5, 5)  
  9.    mystery_int_3 = random.randint(-5, 5)  
  10.    print(str(mystery_int_1) + " " + str(mystery_int_2) + " " + str(mystery_int_3))

Explanation:

Firstly import random module (Line 1).

Next, create three variables to hold the three mystery numbers (Line 3-5). Display the first set of three mystery numbers in one line (Line 6).

While any one of the three mysteries number  still bigger than zero, the while loop will keep going (Line 8). In the loop, three new mystery numbers will be generated using the randint method (Line 9-11). We presume the random value is in range -5 to 5. Print the new set of mystery number on the same line (Line 12).  

6 0
3 years ago
Complete the statement below using the correct term.<br>Website managers use<br>every day​
Leni [432]

Answer:

computers

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Isabella is a security support manager for a large enterprise. In a recent meeting, she was asked which of the standard networki
    5·1 answer
  • Sometimes your Internet is slow and sluggish, what are some common problems that affect network functionality. Check all that ap
    14·1 answer
  • According to the video, what are some hazards Stationary Engineers may face? Check all that apply. noise, hazardous materials, d
    7·2 answers
  • If you are trying to improve your budget and spending, which option would save you the most money?
    13·2 answers
  • 5. How many subnets are possible in a network with a /19 CIDR?
    5·1 answer
  • What is the command for basic router configuration?
    6·1 answer
  • 1. Write a 400-500 word research report about Burke High School.
    6·1 answer
  • What is the outcome when a floating-point number is divided by zero?
    12·1 answer
  • Congress are smart becuase.....
    11·1 answer
  • Use USB in a sentence
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!