Java Data Structures
Develop the algorithm for a program that will do the following:
* Prompt the user for a string
* Reverse the string and display the result on screen
* Continue doing this until the user quits
// dear student here is code compile it and run it below the program i kept the output
import java.util.Scanner;
public class DemoStringReverse {
public static void main(String[] args) {
// TODO Auto-generated method
stub
char ch;
Scanner sc=new
Scanner(System.in);
do
{
System.out.println("Enter any string");
String
str=sc.next();
StringBuilder
sb=new StringBuilder(str);
sb.reverse();
System.out.println(sb);
System.out.println("Do you want to continue(y/n)");
ch=sc.next().charAt(0);
}while(ch=='y' || ch=='Y');
}
}
output
---------
Enter any string
ram
mar
Do you want to continue(y/n)
y
Enter any string
sita
atis
Do you want to continue(y/n)
y
Enter any string
jhansi
isnahj
Do you want to continue(y/n)
n
Java Data Structures Develop the algorithm for a program that will do the following: * Prompt...
Data Structures Java 1. Develop an algorithm for evaluating desirable qualities in individuals. Your algorithm should look for specific features and accept a ranking on each criterion for each person evaluated. It should evaluate individuals until the user quits. [22 points] For the desirable qualities of the individuals I used basic criteria of their Academic Major,Are the doing Average , Good or Excellent , if it helps :) Ex. Name : John Major : Computer science Status: Excellent Name: James Major...
Please make a JAVA program for the following using switch structures Write a program that simulates a simple Calculator program. The program will display menu choices to the user to Add, Subtract, Multiply and Divide. The program will prompt the user to make a selection from the choices and get their choice into the program. The program will use a nested if….else (selection control structure) to determine the user’s menu choice. Prompt the user to enter two numbers, perform the...
Develop a Java program that will store data in the form of daily average temperatures for one week. Store the day and average temperature in two different arraylists. Your program should prompt the user for the day of the week (Monday through Sunday) and display both the day and temperature for each day. If “week” is entered, the output for your program should provide the temperature for each day and the weekly average. Use the looping and decision constructs in...
Write a Java program to meet the following requirements: 1. Prompt the user to enter three strings by using nextLine(). Space can be part of the string). ( Note: your program requires using loop: for-loop, while-loop or do-while-loop to get the input String ) 2. Write a method with an input variable (string type).The method should return the number of lowercase letters of the input variable. 3. Get the number of the lowercase letters for each user input string by...
In Java
2. Array Exercise ( 10 points) Write a Java program that will prompt the user to input a size of an array. Create an array of type int. Ask a user to fill the array. Create a functions sortArray() and mostFrequency(). The sortArray() function will sort number into incrementing order. The sorting function must be implemented from scratch and it must not use any function from the library. Feel free to use any sorting algorithm. The program will...
Develop a complete java program that produces a square pattern of asterisks and spaces. First prompt the user for the size of the pattern, then use for loops to print out the pattern. If the user enters a value that is not a number your program's behavior is arbitrary. For non-positive values your program should print nothing and end normally. Your program should work for input values up to the width of the terminal window. Examples for the first 6...
Using Java, please create the program for the following prompt.
MUST CREATE BUTTONS IN A JFRAME, as specified by the prompt! DO NOT
use user input of 1, 2, 3 etc. User input must come from clicking
the buttons. Please be sure to test your program. Thank you!
Write a program that displays three buttons with the names or images of three candidates for public of office. Imagine that a person votes by clicking the button that shows the candidate...
Design a calculator program that will add, subtract, multiply, or divide two numbers input by a user.Your program should contain the following:-The main menu of your program is to continue to prompt the user for an arithmetic choice until the user enters a sentinel value to quit the calculatorprogram.-When the user chooses an arithmetic operation (i.e. addition) the operation is to continue to be performed (i.e. prompting the user for each number, displayingthe result, prompting the user to add two...
Create a Java program application that creates an ArrayList that holds String objects. It needs to prompt the user to enter the names of friends, which are then put into the ArrayList; allow the user to keep adding names until they enter "q" to quit. After input is complete, display a numbered list of all friends in the list and prompt the user to enter the number of the friend they wish to delete. After deleting that entry, output the...
programming in Microsoft visual studio. Write a C++ program for the following algorithm. Compile, run, and verify the result by choosing some test data. Prompt user to write X1 value in double Read X1 Prompt user to write X2 value in double Read X2 Prompt user to write Y1 value in double Read Y1 Prompt user to write Y2 value in double Read Y2 Compute the lengths of the two sides of the right triangle generated by the two points...