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
onsider the following program: Peform a total of six exercises. Select one exercise from each of the following areas: hips and l
Leviafan [203]

Answer:

Beginner

Explanation:

A program like this is ideal for a beginning exerciser due to the high number of repetitions and the sets are not much.

Cheers

3 0
3 years ago
This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balance
aksik [14]

Answer:

import java.util.Scanner;

public class TeamRoster {

  public static void main(String[] args) {

     Scanner scan = new Scanner(System.in);

     int[][] players = new int[5][2];

     boolean keepAlive = true;

     char input;

     

     for (int i = 0; i < 5; i++) {

        System.out.println("Enter player " + (i+1) + "'s jersey number: ");

        players[i][0] = scan.nextInt();

        if( players[i][0] >= 0 && players[i][0] < 100 ) {

             System.out.println("Enter player number less than 100");

               System.out.println("Enter player " + (i+1) + "'s rating: ");

               players[i][1] = scan.nextInt();

               if ( players[i][1] >= 1 && players[i][1] <10 ) {

                     System.out.println();

               }    else {

                     System.out.println("Enter player " + (i+1) + "'s rating: ");

                     players[i][1] = scan.nextInt();

               }

     }

     }

     System.out.println();

     outputRoster(players, 0);

     

     while (keepAlive) {

        outputMenu();

        input = scan.next().charAt(0);

        if (input == 'q') {

           keepAlive = false;

           break;

        } else if (input == 'o') {

           outputRoster(players, 0);

        } else if (input == 'u') {

           System.out.println("Enter a jersey number: ");

           int jerseyNum = scan.nextInt();

           System.out.println("Enter a new rating for the player: ");

           int newRating = scan.nextInt();

           for (int l = 0; l < 5; l++) {

              if (players[l][0] == jerseyNum) {

                 players[l][1] = newRating;

              }

           }

        } else if (input == 'a') {

           System.out.println("Enter a rating: ");

           int rating = scan.nextInt();

           outputRoster(players, rating);

        } else if (input == 'r') {

           System.out.println("Enter a jersey number: ");

           int jerseyNum = scan.nextInt();

           boolean exists = true;

           for (int l = 0; l < 5; l++) {

              if (players[l][0] == jerseyNum) {

                 System.out.println("Enter a new jersey number: ");

                 players[l][0] = scan.nextInt();

                 System.out.println("Enter a rating for the new player: ");

                 players[l][1] = scan.nextInt();

              }

           }

           

        }

     }

     

     return;

  }

   

  public static void outputRoster(int[][] players, int min) {

     System.out.println(((min>0) ? ("ABOVE " + min) : ("ROSTER")));

     int item = 1;

     for (int[] player : players) {

        if (player[1] > min) {

           System.out.println("Player " + item + " -- Jersey number: " + player[0] + ", Rating: " + player[1]);

        }

        item++;

     }

     System.out.println();

  }

   

  public static void outputMenu() {

     System.out.println("MENU");

     System.out.println("u - Update player rating");

     System.out.println("a - Output players above a rating");

     System.out.println("r - Replace player");

     System.out.println("o - Output roster");

     System.out.println("q - Quit\n");

     System.out.println("Choose an option: ");  

  }

}

Explanation:

The program is written in Java.

It is a bit straightforward.

The Scanner module is declared and used to collect input from the user.

The program prompts the user for each player jersey then rating.

All five players details are collected.

The program shows the output of all the entries.

5 0
3 years ago
The World Wide Web Consortium enforced a stricter set of standards in a different version of Hypertext Markup Language (HTML) ca
Eva8 [605]

Answer:

Option B is the correct answer for the above question

Explanation:

XHTML is an advanced version of HTML language which is recommended by W3C. It set the standard in 26-JAN-2000 for the XHTML which belongs to the family of HTML. XHTML is made with the help of XML and also used like XML. It used to create more secure websites.

The Above question asked about the W3C recommendation but the above paragraph described that XHTML is a W3C recommendation. Hence Option B is the correct choice answer. while the other is not because--

  • Option A suggests HTML 4.01 which is the updated version of HTML only.
  • Option C suggests XML which is used to data transfer only.
  • Option D suggests about DHTML but XHTML is a W3C recommendation
5 0
2 years ago
Which of the following websites is least biased
labwork [276]
I think it's D because it's made out of facts. The other ones are more likely to include bias.
8 0
3 years ago
Write two sentences but each one having either computer in it or technology in it. You can use a word more than once in a senten
Ksju [112]

Answer:

Sentences:

1.My computer has a virus

2.Technology may take over the world someday

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • Load the solver add-in if it is not already loaded. click the budget worksheet and set the objective to calculate the highest ba
    15·1 answer
  • Write a program that unpickle's employee dictionary and while reading from the dictionary, it allows users to lookup an employee
    9·1 answer
  • Two employees were very different in terms of​ age, gender, and other demographic data but they shared a common love of dogs and
    8·1 answer
  • Portable Document Format (PDF) is a file format that provides an electronic image of a document and can be viewed, printed, and
    12·2 answers
  • The cat store needs your help! The base class Animal has private fields animalName, and animalAge. The derived class Cat extends
    9·1 answer
  • How will Artificial Intelligence change the way we do things? .......C-Claim:
    10·1 answer
  • Open the NetBeans IDE and create a new project named MySizes.java. Your program should do the following:
    9·1 answer
  • What type of computer/device do you have i need it for a survey and it due today soooooooooooooo
    14·1 answer
  • Write a python program that will read a number (num) and display all the numbers divisible by 3 or 5
    15·1 answer
  • Class Main {
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!