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]
2 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]2 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
Which is the highest level of the hierarchy of needs model?
navik [9.2K]
I believe the answer is C.
5 0
3 years ago
Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
enyata [817]

Answer:

Statement to get input values:-

cin>>birthMonth>>birthYear;

Statement for output:-

cout<<birthMonth<<"/"<<birthYear<<endl;

Explanation:

The statements are in C++ language.

To get the input we use cin in C++ with >>.

We are taking the input of birthMonth and birthYear.

For printing we use cout .We have printed birthMonth then slash and then birthYear.

6 0
3 years ago
A bike share program in Indianapolis allows customers to borrow a bike and charge them based on the length of their ride.
REY [17]

Answer:

public static double calculate_fee(int lengthofRide, String membership){

       double fee = 0.0;

       if(membership.equalsIgnoreCase("daily")){

           fee = 1.50 +(lengthofRide*20);

       }

       else if (membership.equalsIgnoreCase("annually")){

           fee = 1.0+(lengthofRide*15);

       }

       return fee;

   }

Explanation:

The solution is implemented in Java. The complete code prompting the user to enter ride duration and membership type is given below:

import java.util.Scanner;

public class num4 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter your membership \"daily\" of \"annually\"");

       String membership = in.nextLine();

       System.out.println("Enter your ride duration in minutes");

       int rideTime = in.nextInt();

       //calling the method calculate_fee

       System.out.println("Your total fee based on your membership is "+calculate_fee(rideTime,membership));

   }

   public static double calculate_fee(int lengthofRide, String membership){

       double fee = 0.0;

       if(membership.equalsIgnoreCase("daily")){

           fee = 1.50 +(lengthofRide*20);

       }

       else if (membership.equalsIgnoreCase("annually")){

           fee = 1.0+(lengthofRide*15);

       }

       return fee;

   }

}

4 0
3 years ago
RAM that can be changed. True or False
vredina [299]
The answer is True is
6 0
3 years ago
Read 2 more answers
Checking authentication, checking authorization and access control, auditing systems, and verifying firewalls and other filters
nadezda [96]

Answer: Logical security list

Explanation:Logical security list that is used for checking of the authentication and authorization for the organizations. It consist the safeguarding the software, security access of password and other keys, system auditing, stages of the security etc.

These factors helps in the maintaining the level of the security and only authorized access to place in the system of a particular organization.Other options are incorrect because physical security system consist of the guards , locks etc physical devices, response plane is the feedback strategy and whiltelist is related with the acceptable people.

3 0
3 years ago
Other questions:
  • To determine what to study, one should first
    8·1 answer
  • Please help me complete this task for ICT! Its about Hardware and Software
    12·1 answer
  • Which of these is not one of the main parts of an email
    9·1 answer
  • Text can be easily moved from one location to another using _____.
    15·1 answer
  • कम्प्यूटर में एक समस्या को ठीक करने के लिए एक कार्यक्रम या कोनफीगरेशन परिवर्तन के बाद किए जाते हैं
    5·1 answer
  • Convert each of the fo" wing base ten representations to its equivalent binary form a. 6 b. 13 C. d. 18 e. 27
    6·1 answer
  • Write a program that prompts the user to enter two positive integers less than 1,000,000,000 and the program outputs the sum of
    15·1 answer
  • Suppose you have a class called Child with an instance data value called weight and height. Then it has a method called doubleWe
    5·1 answer
  • A user finished working on a computer in the lab. What should the user do so
    15·1 answer
  • State the Limitations of the first generation of computers​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!