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
jonny [76]
3 years ago
6

Write a pseudocode algorithm that prompts the user to enter a three-digit number and outputs the hundreds, tens and units.

Computers and Technology
1 answer:
chubhunter [2.5K]3 years ago
5 0

Answer:

INPUT "Enter three-digit number" as number

IF number length equals 3 AND is integer:

  hundreds = integer of number / 100

  tens = inter of (remainder of (number / 100) / 10)

  units = remainder of number / 10

  PRINT hundreds + " hundreds"

  PRINT tens + " tens"

  PRINT units + " units"

ELSE:

  PRINT "You need to input a three-digit integer"

Explanation:

integer of division is usually obtained by casting to integer with int() (or // in python)

remainder of is usually obtained by using the modulo operator (%)

So, if you know how many number do you expect, you starting diving by 1xx with the same number of digits and go down by always using "remainder" of the last result and integer division of the same amount of digits, until you get to units, that you only use the remainder.

You might be interested in
My computer keeps on logging me out when i try to answer a question on brainly. Can somebody please explain why. And give a good
fomenos

Answer:

it could be your internet

Explanation:

mine used to do it to me because of internet and since everyone is one the internet because of the Coronavirus everyone is working online that could be the case

:)

8 0
4 years ago
Read 2 more answers
What does cramming to hand in an assignment
Vikki [24]
Honestly gotta say cramming in an assignment doesnt help at all

5 0
3 years ago
Python Programming
Phoenix [80]

The python program that creates a Bankaccount class for a Bank ATM that is made up of the customers and has a deposit and withdrawal function is given below:

<h3>Python Code</h3>

# Python program to create Bankaccount class

# with both a deposit() and a withdraw() function

class Bank_Account:

def __init__(self):

 self.balance=0

 print("Hello!!! Welcome to the Deposit & Withdrawal Machine")

def deposit(self):

 amount=float(input("Enter amount to be Deposited: "))

 self.balance += amount

 print("\n Amount Deposited:",amount)

def withdraw(self):

 amount = float(input("Enter amount to be Withdrawn: "))

 if self.balance>=amount:

  self.balance-=amount

  print("\n You Withdrew:", amount)

 else:

  print("\n Insufficient balance ")

def display(self):

 print("\n Net Available Balance=",self.balance)

# Driver code

# creating an object of class

s = Bank_Account()

# Calling functions with that class object

deposit()

s.withdraw()

s.display()

Read more about python programming here:

brainly.com/question/26497128

#SPJ1

8 0
2 years ago
Which statement best justifies the use of a high-speed cache in a CPU?
crimeas [40]

Cache memory is a high-speed memory that stores the instructions and data that have been frequently accessed.  It decreases the time it takes to decode the instructions stored in the instruction pipeline.

A.  It decreases the time it takes to decode instructions stored in the instruction pipeline.

<u>Explanation:</u>

Whenever an instruction is invoked or some data is accessed, the CPU looks for it in the cache memory before accessing the main memory.

If the content is found in the cache memory, it accessed from there and then and hence the access time and decode time is reduced as there were no main memory lockups.

6 0
4 years ago
CHALLENGE
Lorico [155]

Answer:

Following are the program to this question:

#include <stdio.h>//using the header file

int main()//main method

{

int y;//defining integer variable y

printf("Enter year value:");//print message

scanf("%d", &y);//use input method for input year value

if (y>= 2101)//defining if block that checks year greater then 2101

   printf("Distant future");//print message

else if (y>= 2001)//defining else if block that checks year greater then 2001

   printf("21st century"); //print message

else if (y>= 1901)//defining else if block that checks year greater then 1901

   printf("20th century");//print message

else  //defining else block

   printf("Long ago");//print message

   return 0;

}

Output:

Enter year value:1998

20th century

Explanation:

In the given C language code, inside the main method, an integer variable "y" is defined, which allows the user to input the year value, and use the multiple conditions to check the given value and print message when the condition is matched.  

  • Inside the "if" condition block, it checks the "y" variable value is greater and equal to 2101. so, it will print "Distant future", otherwise go to the next condition.
  • In this, if "y" value is greater than equal to "2001", it will print the message "21st century", otherwise go to the next condition.  
  • In this, If the value of "y" is greater than equal to "1901", it will print the message "20th century", and if all the above condition is not true, then it will go to the else block, and it will print "Long ago" as the message.
6 0
3 years ago
Other questions:
  • 12.
    10·1 answer
  • A(n)_______ is malware that arrives in a trojan, disguised as legitimate software, and then sets up a(n) that provides unauthori
    15·1 answer
  • Which of the following is NOT a unit used to measure temperature?
    13·1 answer
  • Which of the following is the largest unit of information?
    15·2 answers
  • what are examples of conditional formatting tools? check all that apply. color scales, icon sets,data bars,cell styles,themes
    8·1 answer
  • Question 4 (7 points)
    6·1 answer
  • In my mouth In my hair..........​
    15·2 answers
  • ______ requires that any electronic communication must be backed up and secured with reasonable disaster recovery infrastructure
    6·1 answer
  • The Synonyms submenu offers a list of synonyms for a word. Is it always a good idea to use whatever synonyms are presented on th
    15·1 answer
  • A program that organizes sequences of automated provisioning tasks. A. Application Packager B. Sequence Manager C. Sequence Logg
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!