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
marshall27 [118]
4 years ago
15

Input a double and print the first two digits after the decimal point with a space between them. Sample run: Please input a deci

mal number: 57.8934 Answer: 8 9 Hint - to complete the second coding activity in lesson 5 you had to learn how to get individual digits from an int value. You can reuse this method once you convert the user input to an appropriate int value (you will need both multiplication and casting for this).
Computers and Technology
1 answer:
Kruka [31]4 years ago
7 0

Answer:

number = float(input("Please input a decimal number: "))

number = int (number * 100)

second_digit = number % 10

first_digit = int(number / 10) % 10

print("Answer: " + str(first_digit) + " " + str(second_digit))

Explanation:

Ask the user to enter a decimal number (number = 57.8934)

Multiply it by 100 (number = 5789.34) and typecast to int (number = 5789)

Use the module to get the second digit (9)

Divide the number by 10 (578.9), typecast to int (578) and use module operator to get the first digit (8)

Print the numbers as requested

You might be interested in
1. Trust can be built in a relationship if:
artcher [175]

Answer:

A

Explanation:

because if both parties feel safe communicating and feel understood by the other party they feel safe trusting the other person and it develops a trust worthy relationship

4 0
3 years ago
Por favor alguem poderia me falar se este Computador Gamer Fox PC FPS Intel Core i5 8GB 3.4 GHZ GeForce GTX 1050Ti 4GB GDDR5 HD
AleksAgata [21]

thats an trash computer

5 0
3 years ago
Another area where the Internet and the Web have had a huge influence is the workplace environment. How different do you think i
Strike441 [17]

Off the top of my head I know there was a lot of researching by means of books. Books were where you went to find information. So nowadays you can find everything with a search engine whereas you had to go to the bookstore back then.

4 0
4 years ago
write an expression taht evaluated to true if and only if the variable s does not contain the string 'end'
natima [27]

Answer:

//check which string is greater

if(strcmp(name1,name2)>0)

//assign name1 to first, if the

    //name1 is greater than name2

    first=name1;

else

    //assign name2 to first, if the

    //name2 is greater than name1

    first=name2;

5)

//compare name1 and name2

    if(strcmp(name1,name2)>0)

   

         //compare name1 and name3

         if(strcmp(name1,name3)>0)

       

             //assign name1 to max, becuase

             //name1 is greater than name2 and name3

             max=name1;

       

Explanation:

7 0
3 years ago
You are trying to determine whether a certain website is a credible source. You notice it has advertisements along the top and s
mojhsa [17]
The main purpose of that website is most likely going to be to persuade you to buy a certain product
7 0
3 years ago
Read 2 more answers
Other questions:
  • Does clearing your hard drive make your computer faster reddit
    13·1 answer
  • What is virtual memory?
    11·1 answer
  • Tamara has $500 she is looking to save for a class trip. She wants to earn the most possible interest and will not need access t
    7·1 answer
  • What will be displayed if the following Java code segment is run? System.out.println("one "); System.out.print("two "); System.o
    12·1 answer
  • A developer is creating an enhancement to an application that will allow people to be related to their employer. Which data mode
    11·1 answer
  • What should you remember about typography while creating your résumé?
    5·1 answer
  • Plz help me I need help​
    6·1 answer
  • What are the steps in preparing a bootable USB installer?​
    11·1 answer
  • Which of the following tabs on the Ribbon contains the command to add a Quick Part to a document? A Design B Insert C View D Hom
    7·1 answer
  • Write the pseudocode for this flowchart
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!