

![Q.5.13 Given the following coding. private String GenerateStars(int x) { String stars = ; if (SALES[x]>=100){ stars = ****](http://img.homeworklib.com/questions/88dd0d60-eb99-11ea-896b-a9ac1adc705f.png?x-oss-process=image/resize,w_560)


PLEASE SOLVE THESE QUESTIONS. USE JAVA FOR CODING.
5.8
import javax.swing.JOptionPane;
public class Question5_8 {
public static void main(String[] args) {
// Java code to display an input dialog with a
message, given title
String choice =
JOptionPane.showInputDialog("Enter {1} to display the vowel
count.\nEnter {2} to display the non vowel count."
+ "\nEnter {0} to exit.");
}
}
Output:

5.9
import javax.swing.JOptionPane;
public class Question5_9 {
public static void main(String[] args) {
// Java code to display a confirm dialog with a message given title and containing only yes/no buttons and showing question message icon
JOptionPane.showConfirmDialog(null, "Continue with the application? ","Continue? ",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
}
}
Output:

5.10
Eg- PRETEST loop:
let i = 10; // set i to 10
// loop that prints the the number from 5 to 1
// since i = 10 > 5, hence the loop is not executed even
once
while(i > 0 and i < 5)
{
Display i;
i = i - 1;
}
POSTTEST loop:
let i = 10; // set i to 10
// loop that prints the the number from 5 to 1
// the loop will be executed for i = 10, (the first iteration)
since the condition is evaluated after the loop statements
// But when the while condition is executed, it returns false,
hence the loop is exited.
do
{
Display i;
i = i - 1;
}while(i > 0 and i < 5);
5.13
private String GenerateStars(int x)
{
String stars = "";
// assuming SALES is an array defined within the class
containing the method
// if statement is used to return the number of stars
based on the SALES amount at index x
// if SALES amount at index x >= 100, then return a
string containing 5 starts i.e *****
// else return a string containing 2 stars i.e
**
if(SALES[x] >= 100){
stars = "*****";
}
else{
stars = "**";
}
return stars;
}
PLEASE SOLVE THESE QUESTIONS. USE JAVA FOR CODING. Q.5.8 Write short Java code to display the...
(NEED FULL CODE PLEASE)write a java program class to calculate and display the areas of 10 rectangles using arrays. * input validation sizes must be between 0-50 inches output to be displayed on the screen and send to an output file. *the output must appear in the following format. rectangle length width area 1 2.0 3.0 6.0 2 - - - - 10 display the rectangle with largest area. rectangle1 area= display the rectangle with smallest area. rectangle2 area=
All code will be in Java, and there will be TWO source code. I. Write the class MailOrder to provide the following functions: At this point of the class, since we have not gone through object-oriented programming and method calling in detail yet, the basic requirement in this homework is process-oriented programming with all the code inside method processOrderof this class. Inside method processOrder, we still follow the principles of structured programming. Set up one one-dimensional array for each field: product...
Use Java to answer the question (Occurrences of a specified character) Write a method that finds the number of occurrences of a special character in a string using the following header: public static int count (String str, char a) For example, count("Welcome", 'e') returns 2. Write a test program that prompts the user to enter a string followed by a character then displays the number of occurrences of the character in the string. In addition to the requirements described in...
Write the code in python, if you cannot answer all the question
please dont anser, thanx very much. Please gimme a screen shot for
code.
Write clear code with comments and follow coding convention. Comments should include your name, student number and subject code on top of your code Question 1 Create a list to store all the subject codes that you are currently doing at UOW Then use for loop to display it in a table as in the...
using java
Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...
Please write a java program with a input file "jabberwock.txt", and output the "output.txt" with following requirement. You and your partner will be writing a simple Java program that implements some basic file I/O operations. You can use this code as the basis for some of your next project. FIRST: Write code that prompts the user for the name of a text file, opens that file if it exists and reads the file one line at a time printing each...
Lab Topics • The basics of Array object Use the following Coding Guidelines • When declaring a variable, you usually want to initialize it. Remember you cannot initialize a number with a string. Remember variable names are case sensitive. Use tabs or spaces to indent code within blocks (code surrounded by braces). Use white space to make your program more readable. Use comments after the ending brace of classes, methods, and blocks to identify to which block it belongs. Problem...
I need help please... Intro to Programming in C – small program 8 Project objective: To compile, build, and execute an interactive program using character arrays and string.h functions **Submit source code (prog8.c) through Canvas • One source code file (unformatted text) will be submitted • The file name must match the assignment • The code should be tested and run on a Microsoft compiler before it is uploaded onto Canvas • The code must be submitted on time in...
***Please use java code for the question below*** Write a program that calculates the future value of a given investment at a given interest rate for a specified number of years. The formula for this calculation is: value = investmentAmount * (1 + monthly interest rate)years*12 Use text fields for the user to enter the numbers (Investment Amount, Number of Years, and Annual Interest). To get/load data from the textbox, (in this case doubles) use the following structure: (bold are...
WRITE THIS PROGRAM IN JAVA CODING ONLY ! Program 1: In Order Using an IF/ELSE IF/ELSE structure, write a program that will prompt the user for three numbers and displays them in ascending order. First, the program will prompt the user for each of the three numbers. Next, find the smallest value of the three. Then decide which of the other two is the next smallest. Then have the program display the three numbers in ascending order. Be sure to...