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
Allisa [31]
3 years ago
14

Write a functiongetNumber()that takes an upper case letter and returns thenumber according to the international standard above.W

rite a test program that prompts the user to enter a phone number as a string.The input number may contain letters. The program translates a letter (uppercaseor lowercase) to a digit and leaves all other characters intact.Here are sample runs of the program:Enter a string: 1-800- Flowers1 -800 -3569377Enter a string: 1800 flower
Computers and Technology
1 answer:
nataly862011 [7]3 years ago
5 0

Answer / Explanation:

To properly answer this question, we will utilize the python programming language.

The Python programming language is a general purpose and high level programming language. You can use Python for developing desktop GUI applications, websites and web applications. Also, it allows you to focus on core functionality of the application by taking care of common programming tasks.

Now, moving forward to write the program, we have:

def string_test(s):

   d={"UPPER_CASE":0, "LOWER_CASE":0}

   for c in s:

       if c.isupper():

          d["UPPER_CASE"]+=1

       elif c.islower():

          d["LOWER_CASE"]+=1

       else:

          pass

   print ("Original String : ", s)

   print ("No. of Upper case characters : ", d["UPPER_CASE"])

   print ("No. of Lower case Characters : ", d["LOWER_CASE"])

string_test('Enter Phone Number')

You might be interested in
Give an example of an if/else statment and a case statment that are equivalent. Your example should contain at least three choic
zimovet [89]

Answer:

The if - else and equivalent switch case statements in c++ language are given below.

if ( ch == 1 )

       cout << " sum is " << x + y << endl;

   else if ( ch == 2 )

       cout << " difference is " << x - y << endl;

   else if ( ch == 3 )

   {

       cout << " Quitting " << endl;

       exit;

   }

switch( ch )

   {

       case 1 :    cout << " Sum is " << x + y << endl;

                   break;

       case 2 :    cout << " Difference is " << x - y << endl;

                   break;

       case 3 :    cout << " Quitting " << endl;

                   break;

   }      

Explanation:

The above statements use three variables which are declared and initialized as shown.

int x = 10;

    int y = 25;

    int ch;

The above statements execute for of addition, subtraction or to quit the program.

cout << " 1. Addition " << endl;

    cout << " 2. Subtraction. " << endl;

    cout << " 3. Quit " << endl;

    cout << " Enter your choice " << endl;

The variable ch holds the numerical option entered by the user.

    cin >> ch;

For if - else statements, the if statement is executed based on the value of variable ch entered by the user. After execution, the compiler goes out of the statements automatically.

Following the if – else, if any statement is present, it will be executed.

For switch case, every case ends with break keyword. After the required case is executed based on the value of variable ch entered by the user, the break statement is executed which causes the switch case to terminate the control goes out of the statements.

Following the switch case, if any statement is present, it will be executed.

4 0
3 years ago
My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based
Goryan [66]

Answer:

user_salary = int(input("Please Enter Your Salary : "))

if user_salary in range(10000, 20000):

   print("Tax = ",int(user_salary/100*1))

elif user_salary in range(20000, 30000):

   print("Tax = ",int(user_salary/100*2))

elif user_salary in range(30000, 40000):

   print("Tax = ",int(user_salary/100*3))

else:

   print("No Tax!")

Explanation:

8 0
2 years ago
What term specifies how information systems resources should be used and how they should work together?
jarptica [38.1K]

Answer:

b.Information systems architecture

Explanation:

Information System Architecture defines a system in terms of its resources and how they interact with each other. Some aspects of the Information System Architecture include the data that is managed by the system and the architecture of the application software. Another aspect is configuration, which involves the hardware architecture of the system. The organization of the system takes a look at the maintenance of the system while the communication aspect architecture looks at the networks that link the different resources e.g topology diagrams.

6 0
3 years ago
_________ is the amount of data a storage device can move per second from the storage medium to ram.
mote1985 [20]
<span>data transfer rate..</span>
5 0
4 years ago
The valence electron configurations of several atoms are shown. how many bonds can each atom make without hybridization? 2s^2 2p
Pie
Answer: This element needs 3 electrons to complete its octet state

Why?:
since the electrons in 2s2 are already paired they cannot form a bond pair with electrons from other elements without hybridisation however the 3 electrons in 2p3 are unpaired so can form bond pairs with electrons from other elements without hybridisation.

Hope this helps!
3 0
4 years ago
Other questions:
  • Which of the following menu commands would you select to make a copy of an open file and rename it
    14·2 answers
  • This career involves answering questions about computer parts and trouble shooting broken computers? Video game designer, comput
    10·1 answer
  • Give examples of two IP addresses (that are 100 IP addresses away from each other but the last octet is not greater than .150) t
    15·1 answer
  • Select the instances in which you should include a comma.
    13·1 answer
  • Which of the following solutions enables simultaneous digital transmission of voice, video, data, and other network services ove
    7·1 answer
  • What considerations should you make when deciding on the size of a table?
    9·1 answer
  • This finding maximum number function will keep on going until we reach at the last value
    12·1 answer
  • Amber wants to give her audience copies of her presentation so they can follow along and take notes. What option should Amber ch
    9·2 answers
  • Leslie’s parents put a big dry-erase board on the refrigerator and let the kids write suggestions for how to organize and assign
    14·1 answer
  • Public class Billing {
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!