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
nignag [31]
3 years ago
13

Write a program which takes a string input, converts it to lower case, then prints the same string with all vowels (a, e, i, o,

u) removed.
Hint: one good way to do this is to make a new String variable and add all the letters you want to print (i.e. everything except vowels) to it.

Sample Run:

Enter String:
Animation Rerun
nmtn rrn
Computers and Technology
1 answer:
Flauer [41]3 years ago
5 0

Answer:

Scanner scan = new Scanner(System.in);

  System.out.println("Enter String:");

  String v = "aeiou";

  String t = scan.nextLine();

  t =t.toLowerCase();

  String nt ="";

  for(int i = 0; i < t.length(); i++){

  char c = t.charAt(i);

  if (v.indexOf(c) == -1){

  nt += c;

    }

    }

  System.out.println(nt);

   

}

 

}

Explanation:

Good Luck

You might be interested in
#A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
lara [203]

Answer:

To check if the year comes under each 100th year, lets check if the remainder when dividing with 100 is 0 or not.

Similarly check for 400th year and multiple 0f 4. The following C program describes the function.

#include<stdio.h>

#include<stdbool.h>

bool is_leap_year(int year);

void main()

{

int y;

bool b;

 

printf("Enter the year in yyyy format: e.g. 1999 \n");

scanf("%d", &y);     // taking the input year in yyyy format.

 

b= is_leap_year(y);  //calling the function and returning the output to b

if(b==true)

{

 printf("Thae given year is a leap year \n");

}

else

{

 printf("The given year is not a leap year \n");

}

}

bool is_leap_year(int year)

{

if(year%100==0)   //every 100th year

{

 if(year%400==0)   //every 400th year

 {

  return true;

 }

 else

 {

  return false;

 }

}

if(year%4==0)  //is a multiple of 4

{

 return true;

}

else

{

 return false;

}

}

Explanation:

Output is given as image

5 0
3 years ago
"Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS is broken.The specificatio
timama [110]

Answer:

see explaination

Explanation:

// Include the necessary header files.

import java.io.*;

import java.util.Random;

import java.lang.Math;

// Declare a class

public class GPS

{

// Definition of the function.

public static int randSel(int start, int fin)

{

// Declare the object of a class.

Random r = new Random();

// Declare an integer value and store

// value in it.

int rNum = r.nextInt((fin - start) + 1) + start;

// return value.

return rNum;

}

// Definition of the function.

public static double DistFromOrig(double X, double Y)

{

// Declare a double variable.

double dist;

// Calculate the distance.

dist = Math.sqrt(X * X + Y * Y);

// return distance.

return dist;

}

// Start the main method.

public static void main(String[] args)

{

try

{

// declare variables

double X = 0, Y = 0;

int time = 60;

final int NORTH = 0;

final int EAST = 1;

final int SOUTH = 2;

final int WEST = 3;

int Direction = 0;

// Start the while loop

while (time > 0)

{

// check whether the time is greater

// than 5 or not.

if (time >= 5)

{

// update the value of time.

time -= 5;

// call to the method.

Direction = randSel(0, 3);

if (Direction == NORTH)

{

// update the value of y cordinate.

Y = Y + 5;

// display the statement on console.

System.out.println("MOVED NORTH");

}

// Check the direction

if (Direction == EAST)

{

// update the value of x cordinate.

X = X + 5;

// display the statement on console.

System.out.println("MOVED EAST");

}

// Check the direction

if (Direction == WEST)

{

// update the value of x cordinate.

X = X - 5;

// display the statement on console.

System.out.println("MOVED WEST");

}

// Check the direction

if (Direction == SOUTH)

{

// update the value of y cordinate.

Y = Y - 5;

// display the statement on console.

System.out.println("MOVED SOUTH");

}

}

else

{

// Check the direction

if (Direction == NORTH)

{

// update the value of y cordinate.

Y = Y + time * 1;

time = 0;

}

// Check the direction

if (Direction == EAST)

{

// update the value of x cordinate.

X = X + time * 1;

time = 0;

}

// Check the direction

if (Direction == WEST)

{

// update the value of x cordinate.

X = X - time * 1;

time = 0;

}

// Check the direction

if (Direction == SOUTH)

{

// update the value of y cordinate.

Y = Y - time * 1;

time = 0;

}

}

}

// Display the statement on console.

System.out.println(

"Distance of Car After Traveling 1 Hr is "

+ DistFromOrig(X, Y)

+ " miles");

}

// Start the catch block.

catch (Exception e)

{

e.printStackTrace();

}

}

}

4 0
3 years ago
This might sound crazy! But please help.
aliya0001 [1]

Answer:

You Probably should’nt do that

Explanation:

8 0
1 year ago
There are local administrators for each of the departments, excluding the IT. These local administrators will use the local admi
torisob [31]

Answer:

Listed below are the few ways Linux Server can be secured

1. Group policies: This is a way to ensure security by applying group policies and permissions both on the group level and the files level. Through proper permission configuration we can easily restrict other users from accessing those files and directories.

2. Implementation of the firewall: Implementing firewall in each of the Linux server will definitely help in securing your machine from outside threats. Iptables will help in filtering the network traffic that are entering into the system and even going out of the system.

3.Enabling SELINUX: Enabling SELINUX is another way to secure your system especially a Linux Server. Selinux is a powerful security that checks and allows applications to run into the system. It won't allow any untrusted application to run into the system.

6 0
3 years ago
Why is it important to have a price assiociated in every product​
artcher [175]

Answer:

The wrong price can also negatively influence sales and cash flow. tbh there is no point to me  

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • 2. You have classes to represent different shapes (see below). You realize you can benefit from inheritance and polymorphism by
    13·1 answer
  • The set of instructions that directs the computer to perform a variety of tasks is known as a
    9·1 answer
  • ________ is used for supervisory messages at the internet protocol layer.
    10·1 answer
  • Lube job---------$18.00
    14·1 answer
  • If you place a semicolon after the test expression in a while loop, it is assumed to be a(n) ________. a. pre-test loop b. post-
    9·1 answer
  • In a distributed database system, the data placement alternative with the highest reliability and availability is Group of answe
    9·1 answer
  • Write a program that receives an character and displays its Unicode. Here is a sample run: Enter an character: E The Unicode for
    8·1 answer
  • Today's Apple Mac computers run with the same internal hardware as the Windows-based PC.
    10·2 answers
  • Which of these organs is not found in the excretory system
    7·2 answers
  • Assume there is a 30-byte heap. The free list for this heap has two elements on it. One entry describes the first 10-byte free s
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!