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
Ulleksa [173]
4 years ago
14

5.19 LAB: Countdown until matching digits Write a program that takes in an integer in the range 20-98 as input. The output is a

countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is:
Computers and Technology
1 answer:
elena55 [62]4 years ago
3 0

Answer:

Following are the code to this question:

x = int(input())#defining a variable x for user input value  

if(x>=20 and x<=98):#defining an if block that checks value is in between 20 to 98  

   while(not(x%10==x//10)):#defining while loop that seprate numbers and checks it is not equal  

       print(x)#print value

       x-=1# decrease value by subtracting 1

   print(x)# print value

else:#defining else block  

   print("The input value must lie in 20-98")#print message

Output:

36

36

35

34

33

Explanation:

  • In the above python program code, a variable x is declared, which is used to input the value from the user end.
  • In the next step, a conditional statement is used in if block, it checks the input value is lie in 20 to 98, and to check its uses and logic date, if it is false it will goto else section in this, it will print a message.
  • If the given value is true, inside if block a while loop is declared, that separately divide the value and check it is identical or not, if it is not identical it will print the value and checks its less value similarly.
You might be interested in
Assume that you are working with spreadsheets, word processing documents, presentation slides, images, and sound files for a sch
dybincka [34]

Answer:

See explanation below.

Explanation:

File organization is very important especially when one is working with numerous files from different applications.

When you are working with spreadsheets, word processing documents, presentation slides, images and sound files, it is important to create folders and sub-folders to make locating your files a lot easier.

  1. Make sure you have all your files saved with names that are relevant to your school project.
  2. Create a sub-folder to store all spreadsheets files, create a sub-folder to store all word processing files, create a sub-folder to store all presentation slides and create another folder to store images and sound files. You do this to make it easy for you to locate whichever file you want.
  3. You create the sub-folder by right clicking on your documents section and clicking on new folder. Type in the name of the folder and save.
  4. After creating sub-folders,  create a general folder for all your folders by using the same method in step 3. Copy all your sub-folders into this major folder. You can name this folder the name of your school project.

This way, you never have to look for any files for your school project.

6 0
3 years ago
You are asked to develop a cash register for a fruit shop that sells oranges and apples. The program will first ask the number o
vaieri [72.5K]

Answer:

customers = int(input("How many customers? "))

for i in range(customers):

   name = input("Name of Customer " + str(i+1) + " ")

   

   print("Oranges are $1.40 each.")

   oranges = int(input("How many Oranges? "))

   

   print("Apples are $.75 each.")

   apples = int(input("How many Apples? "))

   

   bill = oranges * 1.4 + apples * 0.75

   

   print(name + ", you bought " + str(oranges) + " Orange(s) and " + str(apples) + " Apple(s). Your bill is $%.1f" % bill)

Explanation:

*The code is in Python.

Ask the user to enter the number of customers

Create a for loop that iterates for each customer. Inside the loop, ask the user to enter the name, number of oranges, number of apples. Calculate the bill. Print the name, number of oranges, number of apples bought and total bill

5 0
4 years ago
Which of the following office online apps is most effective for creating
Lorico [155]

Well it really depends on what you are creating. But the most effective app for me for creating photos is Visco.

4 0
4 years ago
Read 2 more answers
A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order. If L1 is the
Free_Kalibri [48]

In this question, we are given ,

  • A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order.
  • L1 is the list consisting of the first n1 numbers in L.
  • L2 is the list consisting of the last n2 numbers in L.

Explanation:

As per the information given in statement 1, 17 is a mode for L1 and 17 is a mode for L2.

Therefore, we can infer that ,

  • 17 must occur in L1, either same or a greater number of times as any other number in L1.
  • 17 must occur in L1, either same or a greater number of times as any other number in L2.

As all elements in L are in ascending order, we can also conclude that

  • Each number between last occurrence of 17 in L1 and the first occurrence of 17 in L2 must be equal to 17 only.
  • Therefore, 17 occurs either same or greater number of times as any other number in L.
  • Thus, 17 is a mode for L.

However, from this statement, we cannot conclude anything about the mode of L1, L2, or L.

Hence, statement 2 is not sufficient to answer the question.

Therefore, 17 is a mode for L1 and 17 is a mode for L2.

3 0
3 years ago
Which of the following is not expected of employees' oral communication skills in the workplace? Communicate clearly Use appropr
Paladinen [302]

Answer:

The skill that is not expected of employees' oral communication skills in the workplace is:

Be able to write well

Explanation:

The reason behind this answer is: we are analyzing oral communication skills. Writing is not in oral communication skills. Therefore it is not expected as an employee oral communication skill in the workplace. Also, Communicate clearly is expected in the workplace, use appropriate language is expected in the workplace as formality is desired, and finally communicating under the laws and regulations of the organization is also expected.

4 0
3 years ago
Other questions:
  • Look at the circuit shown in the figure above. Switch S1 is open as shown, and R1 and R2 each have a value of 100 k. If you conn
    11·1 answer
  • A Uniform Resource Locator (URL) is a formatted string of text that web browsers, email applications, and other software program
    15·2 answers
  • In a Web-based database, middleware is used to transfer information from the organization's internal database back to the Web se
    12·1 answer
  • C++ a. Write a program that uses the function isPalindrome given in example 6-6 (Palindrome). Test your program on the followinn
    5·1 answer
  • Generally, what is the term for storage locations in a processor?
    12·1 answer
  • Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is
    14·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • Why do you usually find domain names instead of IP addresses in a URL? Select one: a. An IP address would make your web page loa
    11·1 answer
  • A type of attack where the adversary intercepts network packets, modifies them, and inserts them back into the network is called
    13·1 answer
  • A bitmap image is provided in two different resolutions. Image 1 has a resolution of 1500 x 1225. Image 2 has a resolution of 50
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!