I need some java programming help from someone to fix the SalonReport below: - import java.util.Scanner;
-
import java.util.Arrays;
-
-
public class SalonReport {
-
-
public static void main(String[] args) {
-
-
int choice;
-
Scanner sc = new Scanner(System.in);
-
Service[] services = new Service[5];
-
-
services[0] = new Service("Cut", 8.00, 15);
-
services[1] = new Service("Shampoo",4, 10);
-
services[2] = new Service("Manicure",18,30);
-
services[3] = new Service("Style",48,55);
-
services[4] = new Service("Permanent",18,35);
-
services[5] = new Service("Trim",6,5);
-
-
System.out.println("Enter how you would like the services sorted (1) Description (2) Price (3) Time: ");
-
choice = sc.nextInt;
-
-
//if choice = 1 then sort by description...
-
//if choice = 2 then sort by price....
-
//if choice = 3 then sort by Time...
-
-
-
-
-
}
-
}
-
-
-
-
public class Service {
-
-
String description;
-
double price;
-
int minutes;
-
-
public Service(String d, double p, int m) {
-
-
description = d;
-
price = p;
-
minutes = m;
-
-
}
-
-
public String getDescription() {
-
-
return description;
-
-
}
-
-
public double getPrice() {
-
-
return price;
-
-
}
-
-
public int getMinutes() {
-
-
return minutes;
-
-
}
-
}
3 2054
I need some java programming help from someone to fix the SalonReport below:
-
import java.util.Scanner;
-
import java.util.Arrays;
-
-
public class SalonReport {
-
-
public static void main(String[] args) {
-
-
int choice;
-
Scanner sc = new Scanner(System.in);
-
Service[] services = new Service[5];
-
-
services[0] = new Service("Cut", 8.00, 15);
-
services[1] = new Service("Shampoo",4, 10);
-
services[2] = new Service("Manicure",18,30);
-
services[3] = new Service("Style",48,55);
-
services[4] = new Service("Permanent",18,35);
-
services[5] = new Service("Trim",6,5);
-
-
System.out.println("Enter how you would like the services sorted (1) Description (2) Price (3) Time: ");
-
choice = sc.nextInt;
-
-
//if choice = 1 then sort by description...
-
//if choice = 2 then sort by price....
-
//if choice = 3 then sort by Time...
-
-
-
-
-
}
-
}
-
-
-
-
public class Service {
-
-
String description;
-
double price;
-
int minutes;
-
-
public Service(String d, double p, int m) {
-
-
description = d;
-
price = p;
-
minutes = m;
-
-
}
-
-
public String getDescription() {
-
-
return description;
-
-
}
-
-
public double getPrice() {
-
-
return price;
-
-
}
-
-
public int getMinutes() {
-
-
return minutes;
-
-
}
-
}
(end of Quote - not in quote tags because of tag bug)
First of all: Wrong section. You want the Java Forum.
Secondly: Please state, what exactly your problem is. What should the program do? What does it do? Are there any errors given? If so, what are these errors?
Last, but not least: Please use CODE tags, when posting code. As you see above, it makes code so much easier to read.
Greetings,
Nepomuk
Moved to the Java forum where you've got more chance of getting help with your problem than the Editor's Corner.
Moderator.
Yes, what is your question? :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: RobertMaas |
last post by:
After many years of using LISP, I'm taking a class in Java and finding
the two roughly comparable in some ways and very different in other
ways. Each has a decent size library of useful utilities...
|
by: Maurice LING |
last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic
typing, is there any other real reasons that Python is slower than Java?
maurice
|
by: DrUg13 |
last post by:
In java, this seems so easy. You need a new object
Object test = new Object() gives me exactly what I want.
could someone please help me understand the different ways to do the
same thing in...
|
by: Mike Cox |
last post by:
Hi. I recently ran a benchmark against two simple programs, one written in
Java and the other in C++. The both accomplish the same thing, outputting
"Hello World" on my screen. The C++ program...
|
by: David Van D |
last post by:
Hi there,
A few weeks until I begin my journey towards a degree in Computer
Science at Canterbury University in New Zealand,
Anyway the course tutors are going to be teaching us JAVA wth bluej...
|
by: =?Utf-8?B?S2Vubnk=?= |
last post by:
I have one bat file that contains a command to startup Java Program. Then, I
would like to create a cluster job to call the bat file. In case of one
computer is down, another computer can also call...
|
by: aureao4 |
last post by:
I'm new to Java and programming. I'm trying to code a payroll program and continue getting errors. The program worked last week, this week I have to add set, get and a class. I've written the class...
|
by: r035198x |
last post by:
Setting up.
Getting started
To get started with java, one must download and install a version of Sun's JDK (Java Development Kit).
The newest release at the time of writting this article is...
|
by: markthien |
last post by:
Hi guys,
I was trying to compile jasper report from java as below:
public static void runReport(String databaseName, String userName,
String password, String reportFile) {...
|
by: Debadatta Mishra |
last post by:
Introduction
In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |