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
Cerrena [4.2K]
3 years ago
13

Write a function:

Computers and Technology
1 answer:
Elden [556K]3 years ago
5 0

Answer:

what are the choices

:"

Explanation:

You might be interested in
How does a computer work?
Gre4nikov [31]

Answer:

A computer is a Device that can run multiple applications at a time and access the internet where you can find online stores and more also used to make video calls and more.

7 0
2 years ago
Read 2 more answers
Which of the following are incident priorities?
xenn [34]

Answer:

what are the options?

reply in comment so i can help:)

5 0
3 years ago
Which math ratio represents efficiency?
andrew-mc [135]

Answer:

I think its the second one

6 0
3 years ago
Write a class with a constructor that accepts a String object as its argument. The class should have a method that returns the n
mote1985 [20]

Answer:

import java.util.Scanner;

public class VowelsAndConsonantsDemo {

   /**

   The printMenu methods displays a menu to the user

    */

   public static void printMenu() {

       System.out.println("Please select an option: ");

       System.out.println();

       System.out.print("a. Count the number of vowels in the string.\n"

               + "b. Count the number of consonants in the string.\n"

               + "c. Count both the vowels and consonants in the string.\n"

               + "d. Enter another string.\n"

               + "e. Exit the program\n");

   }

   public static void main(String[] args) {

       String input;      // to hold the user's input

       String option;     // to hold the user's input

       char choice;       // to hold a single character

       char exit;         // user chooses 'e' to exit the program

       char letter;       //the Y or N from the user's decision to exit

       // create a Scanner object to read keyboard input.

       //  Scanner keyboard = new Scanner(System.in);

       Scanner keyboard;

       do {

           keyboard = new Scanner(System.in);

           // ask user to enter string

           System.out.print("Enter a string: ");

           input = keyboard.nextLine();

           input = input.toLowerCase();

           System.out.println();

           printMenu();

           option = keyboard.nextLine();

           choice = option.charAt(0);

           VowelsAndConsonants words = new VowelsAndConsonants(input);

           switch (choice) {

               case 'a':

               case 'A':

                   System.out.println("Number of Vowels: " + words.getVowels());

                   break;

               case 'b':

               case 'B':

                   System.out.println("Number of Consonants: " + words.getConsonants());

                   break;

               case 'c':

               case 'C':

                   System.out.println("Number of Vowels & Consonants: " + words.getConsonants()

                           + words.getVowels());

                   break;

               case 'd':

               case 'D':

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

                   break;

               case 'e':

               case 'E':

                   System.exit(0);

                   break;

               default:

                   System.out.println("You did not enter a valid choice.");

           }

           //

           // keyboard.nextLine();    //consumes the new line character after the choice

           // String answer = keyboard.nextLine();

           // letter = answer.charAt(0);

       } while (true);

   }

}

4 0
3 years ago
Write a JAVA program to generate the list of prime numbers between 100 and 1000 ?
Svetllana [295]

First of all, we will need a function that checks if a number is prime or not:

boolean isPrime(int n){

 for(int i=2; i<=math.sqrt(n); i++){

   if(n % i == 0) return false;

 }

 return true;

}

Then, in the main program, we will call this function with all the desired inputs, and we will print the prime numbers:

for(int n=100; n<= 1000; n++){

 if(isPrime(n)) print(n);

}

6 0
3 years ago
Other questions:
  • If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
    9·1 answer
  • What are the advantage of transistors over vacuum tubes?
    6·1 answer
  • The index number of a combobox object can be assigned to a(n) ____ data type variable
    13·1 answer
  • Blank determines the overall brightness or darkness of an entire image
    5·1 answer
  • What are the components inside the case typically draw power from a cable connected to the motherboard instead of being connecte
    6·2 answers
  • PLS ANSWER ASAP I WILL GIVE BRAINLIEST
    11·1 answer
  • Why does a print document need a higher raster effect setting ?​
    14·1 answer
  • When the condition of an if statement is false, the computer will return an error message to the user.
    15·2 answers
  • Blank Are input instructions you give to a computer
    13·1 answer
  • Which command must you use at the command prompt to determine the names of the network interfaces (including the isatap interfac
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!