Java Homework Help | Assignment Solution | Online Help
Java programming is one of the programming language widely used for coding by students as well as working professionals. Our expert java programming tutors provide quality help with java programming homework. They are highly skilled and provide help with java programming assignment well within the deadline. Students from across the globe have made use of our java programming homework help. Our experts also provide online java programming homework help to students as well as working professional as per their need. So, if you need help with Java programming assignment help, or you need personal online tutoring in Java programming assignment help then we can be of help.
If you need assistance with your Java programming project then check out this example.
JAVA program 1
Design a program for the Hollywood Movie Rating Guide, which can be installed in a kiosk in theaters.
Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the Guide’s featured movie of the week.
If a user enters a star value that does not fall in the correct range, re-prompt the user continuously until a correct value is entered.
The user gets three tries to enter a valid rating. After three incorrect entries, the program issues an appropriate message and continues with a new user.
The program executes continuously until the theater manager enters a negative number to quit. When the manager enters the negative number end of the program, display the average star rating for the movie.
I can write the pseudocode but cannot make it work in JAVA.
Pseudocode:
start Declarations num numOfStars num count = 0 num total = 0 num attempts num avg num LIMIT = 3 string PROMPT = "Enter the star rating or a negative number to quit >> " housekeeping() while numOfStars >= 0 AND attempts < LIMIT detailLoop() endwhile finishUp() stop housekeeping() output PROMPT input numOfStars attempts = 0 return detailLoop() while (numOfStars > 4 OR numOfStars < 0) AND attempts < LIMIT output "Please re-enter a value from 0 to 4 >> " input numOfStars attempts = attempts + 1 endwhile if attempts < LIMIT then count = count + 1 total = total + numOfStars output PROMPT input numOfStars else output "You have failed to enter a valid rating." output "The program will now end." endif return finishUp() if attempts < LIMIT then avg = total / count output "The average star rating is: ", avg endif output "End of program" return
MovieRatingGuide.java
import java.util.Scanner; public class MovieRatingGuide { private static Scanner in = new Scanner(System.in); private static final int LIMIT = 3; public static void main(String[] args) { // declarations int count = 0; int total = 0; String prompt = "Enter the star rating or a negative number to quit>> "; // house keeping int numOfStars = housekeeping(); while (numOfStars >= 0) { numOfStars = detailLoop(numOfStars); if (numOfStars >= 0 && numOfStars <= 4) { count = count + 1; total = total + numOfStars; } else { System.out.println("You have failed to enter a valid rating."); } // for the next user to enter the rating System.out.print(prompt); numOfStars = in.nextInt(); } // finish up finishUp(total, count); } private static int housekeeping() { String prompt = "Enter the star rating or a negative number to quit>> "; System.out.print(prompt); int numOfStars = in.nextInt(); return numOfStars; } private static int detailLoop(int numOfStars) { String prompt = "Enter the star rating or a negative number to quit>> "; int attempts = 1; // detail loop while ((numOfStars > 4 || numOfStars < 0) && attempts < LIMIT) { System.out.print("Please re-enter a value from 0 to 4 >> "); numOfStars = in.nextInt(); attempts = attempts + 1; } if (attempts < LIMIT) { return numOfStars; } // return -1 to indicate invalid value return -1; } private static void finishUp(int total, int count) { if (count > 0) { double average = total / count; System.out.println("The average star rating is: " + average); } System.out.println("End of program"); } }
You will find an example Java project, that demonstrates the style of the work we are able to do for you.
JAVA program 2
The Downdog Yoga Studio offers five types of classes, as shown in Table 6-2.
Design a program that accepts a number representing a class and the numeric class requests can be entered continuously until a sentinel value is entered.
Then, display each class number, name, and a count of the number of requests for each class.
Class Number | Class Name |
---|---|
1 | Yoga 1 |
2 | Yoga 2 |
3 | Children’s Yoga |
4 | Prenatal Yoga |
5 | Senior Yoga |
Table 6 – 2
I can write the pseudocode but cannot make it work in JAVA.
Pseudocode:
start Declarations num classNum num QUIT = -1 num SIZE = 5 num classCnt[SIZE] = 0 string classes[SIZE] = "Yoga 1", "Yoga 2", "Children's Yoga", "Prenatal Yoga", "Senior Yoga" getReady() while classNum <> QUIT countClasses() endwhile finishUp() stop getReady() output "Enter a class number or ", QUIT, " to quit" input classNum return countClasses() if classNum >= 1 AND classNum <= SIZE then classCnt[classNum-1] = classCnt[classNum-1] + 1 else output "Invalid class number" endif output "Enter a class number or ", QUIT, " to quit" input classNum return finishUp() classNum = 0 while classNum < SIZE output classNum+1, classes[classNum], classCnt[classNum] classNum = classNum + 1 endwhile return
YogaStudio.java
import java.util.Scanner; public class YogaStudio { private static Scanner in = new Scanner(System.in); private static final int QUIT = -1; private static final int SIZE = 5; private static int classNum; public static void main(String[] args) { // declaration int[] classCnt = new int[SIZE]; String[] classes = new String[] { "Yoga 1", "Yoga 2", "Children's Yoga", "Prenatal Yoga", "Senior Yoga" }; getReady(); while (classNum != QUIT) { countClasses(classCnt); } finishUp(classCnt, classes); } private static void getReady() { System.out.print("Enter a class number of " + QUIT + " to quit: "); classNum = in.nextInt(); } private static void countClasses(int[] classCnt) { if (classNum >= 1 && classNum <= SIZE) { classCnt[classNum - 1] = classCnt[classNum - 1] + 1; } else { System.out.println("Invalid class number"); } System.out.print("Enter a class number of " + QUIT + " to quit: "); classNum = in.nextInt(); } private static void finishUp(int[] classCnt, String[] classes) { classNum = 0; while (classNum < SIZE) { System.out.printf("%d %s #%d\n", classNum + 1, classes[classNum], classCnt[classNum]); classNum = classNum + 1; } } }
Below is a Java project, but if you just require a Java online tutor then we can provide that for you as well.
JAVA program 3
Draw the hierarchy chart and design the logic for a program that calculates service charges for Hazel’s Housecleaning service.
The program contains housekeeping, detail loop, and end-of-job modules.
The main program declares any needed global variables and constants and calls the other modules.
The housekeeping module displays a prompt for and accepts a customer’s last name. While the user does not enter ZZZZ for the name, the detail loop accepts the number of bathrooms and the number of other rooms to be cleaned.
The service charge is computed as $40 plus $15 for each bathroom and $10 for each of the other rooms. The detail loop also displays the service charge and then prompts the user for the next customer’s name.
The end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.
Again I can write the pseudocode just can’t convert to JAVA.
Pseudocode:
start Declarations string customerLastName num numOfBaths num numOfOtherRooms num serviceCharge num CHARGE_BASE = 40 num CHARGE_BATH = 15 num CHARGE_OTHER_ROOM = 10 string QUIT = "ZZZZ" string NAME_PROMPT = "Enter the customer's last name: " string BATH_PROMPT = "Enter the number of bathrooms to be cleaned: " string ROOMS_PROMPT = "Enter the number of other rooms to be cleaned: " string END_LINE = "Thank you for using the program" housekeeping() while customerLastName <> QUIT detailLoop() endwhile endOfJob() stop housekeeping() output NAME_PROMPT input customerLastName return detailLoop() output BATH_PROMPT input numOfBaths output ROOM_PROMPT input numOfOtherRooms serviceCharge = CHARGE_BASE + (CHARGE_BATH * numOfBaths) + (CHARGE_ROOM * numOfOtherRooms) output serviceCharge output NAME_PROMPT input customerLastName return endOfJob() output END_LINE return
HousecleaningService.java
import java.util.Scanner; public class HousecleaningService { private static Scanner in = new Scanner(System.in); private static final int CHARGE_BASE = 40; private static final int CHARGE_BATH = 15; private static final int CHARGE_OTHER_ROOM = 10; private static final String QUIZ = "ZZZZ"; private static final String NAME_PROMPT = "Enter the customer's last name: "; private static final String BATH_PROMPT = "Enter the number of bathrooms to be cleaned: "; private static final String ROOMS_PROMPT = "Enter the number of other rooms to be cleaned: "; private static final String END_LINE = "Thank you for using the program"; private static int numOfBaths; private static int numOfOtherRooms; private static int serviceCharge; public static void main(String[] args) { // declarations String customerLastName; customerLastName = housekeeping(); while (!customerLastName.equals(QUIZ)) { customerLastName = detailLoop(); } endOfJob(); } private static String housekeeping() { System.out.print(NAME_PROMPT); String name = in.nextLine(); return name; } private static String detailLoop() { System.out.print(BATH_PROMPT); numOfBaths = in.nextInt(); System.out.print(ROOMS_PROMPT); numOfOtherRooms = in.nextInt(); serviceCharge = CHARGE_BASE + (CHARGE_BATH * numOfBaths) + (CHARGE_OTHER_ROOM * numOfOtherRooms); System.out.println("The service charge is: " + serviceCharge); in.nextLine(); // enter the name of the next user System.out.print(NAME_PROMPT); String name = in.nextLine(); return name; } private static void endOfJob() { System.out.println(END_LINE); } }
Our experts are available 24*7 to provide help with java programming homework. We offer best quality solutions and plagiarism free java programming assignment help If you are seeking Java programming homework help, then we can provide you with the solution, that is guaranteed plagiarism free. Students just have to upload their assignment on our programming website to avail our java programming homework help. Our experts understand the complexity of java codes and hence they provide codes that are easy to understand in java programming project help We are also available via live-chat to offer java programming assignment help