Please could everyone help me to fix the errors.....
I have 2 errors
GradePoint.java:62: '}' expected
GradePoint.java:65: Statement expected
Private static void totalPoints(Type[] ty)
^
2 errors
The line 65 i add } and still errors then I keep add until line 64. Then I got 38 errors.
Could everyone help me out this problem please
Thanks I lot for your help,
Flower
public class GradePoint
static final int A = 4;
static final int B = 3;
static final int C = 2;
static final int D = 1;
static final int F = 0;
public static void main(String[] args) throws Exception
Type[] someTypes = new Type[5];
char[] copyCode = {'A', 'B', 'C', 'D', 'F'};
int[] copyPoint = {A, B, C, D, F};
int x;
char Type;
int point = 0;
boolean codeIsValid = false;
char[][] studentGrades = new char[10][];
for(int student = 0; student < 10; ++student)
studentGrades[student] = new char [5];
for(int student = 0; student<10; ++student)
System.out.println("Enter grades for student # " +(student + 1));
for(int course = 0; course < 5; ++course)
for(x = 0; x<5; ++x)
System.out.println("Enter Type of points");
System.out.println("A is four grade points");
System.out.println("B is three grade points");
System.out.println("C is two grade points");
System.out.println("D is one grade point");
System.out.println("F is zero grade point");
Type = (char)System.in.read();
System.in.read();System.in.read();
codeIsValid = false;
for(int i = 0; i < 5; ++i)
if(event == copyCode)
point = copyPoint[i];
codeIsValid = true;
if(codeIsValid)
someTypes[x] = new Type(type, point);
else
--x;
for(x=0; x<5; ++x)
System.out.println("Type " + (x+1) + " " + someTypes[x].getCopyType()+" " + someTypes[x].getCopyPoint());
totalPoints(someTypes);
for(x =0; x<5; ++x)
System.out.println("Type " + (x+1) + " " + someTypes[x].getCopyType()+ " "+ someTypes[x].getCopyPoint());
private static void totalPoints(Type[] ty)
int GPA;
for(int p = 0; p < 5; ++p)
GPA = ty[p].getCopyPoint();
GPA += 5;
ty[p].setCopyPoint(GPA);
Here are some corrections to your code. Every { needs a } Also, the } after your field declarations in the main method caused some problems because you were ending your main method before you most of your code.
When I corrected those problems, the only errors I get are class not found (type) and uncaught IOExceptions.
public class GradePoint
static final int A = 4;
static final int B = 3;
static final int C = 2;
static final int D = 1;
static final int F = 0;
int x;
Type[] someTypes = new Type[5];
char[] copyCode = {'A', 'B', 'C', 'D', 'F'};
int[] copyPoint = {A, B, C, D, F};
char Type;
int point = 0;
boolean codeIsValid = false;
public static void main(String[] args) throws Exception
int x;
Type[] someTypes = new Type[5];
char[] copyCode = {'A', 'B', 'C', 'D', 'F'};
int[] copyPoint = {A, B, C, D, F};
char Type;
int point = 0;
boolean codeIsValid = false;
char[][] studentGrades = new char[10][];
for(int student = 0; student < 10; ++student)
studentGrades[student] = new char [5];
for(int student = 0; student<10; ++student)
System.out.println("Enter grades for student # " +(student + 1));
for(int course = 0; course < 5; ++course)
for(x = 0; x<5; ++x)
System.out.println("Enter Type of points");
System.out.println("A is four grade points");
System.out.println("B is three grade points");
System.out.println("C is two grade points");
System.out.println("D is one grade point");
System.out.println("F is zero grade point");
Type = (char)System.in.read();
System.in.read();System.in.read();
codeIsValid = false;
for(int i = 0; i < 5; ++i)
if(event == copyCode)
point = copyPoint[ i ];
codeIsValid = true;
if(codeIsValid)
someTypes[x] = new Type(type, point);
else
--x;
for(x=0; x<5; ++x)
System.out.println("Type " + (x+1) + " " + someTypes[x].getCopyType()+" " + someTypes[x].getCopyPoint());
totalPoints(someTypes);
for(x =0; x<5; ++x)
System.out.println("Type " + (x+1) + " " + someTypes[x].getCopyType()+ " "+ someTypes[x].getCopyPoint());
private static void totalPoints(Type[] ty)
int GPA;
for(int p = 0; p < 5; ++p)
GPA = ty[p].getCopyPoint();
GPA += 5;
ty[p].setCopyPoint(GPA);
}
Similar Messages
-
; hi good plzz do help me to fix the error to my bb9300 i just update my bb9300 the the i see
error b Uncaught exception: java.lang.NullPointerException anyone here can help me to fix i appreciateI am guessing that you are not a Java developer, and it is not your application that is causing the Null Pointer Exception.
It sounds like you have updated the OS on your Blackberry device and one of the applications that you have installed is not coping with the upgrade.
If you press on an application icon and then that causes the error, then you know there is a problem with that application and so you need to report this to the developers of that application and get an updated version.
If this is happening when you restart your device, then it appears that one of the installed applications is failing at start up time and so it is not obvious which application. So you need to see which of your applications doesn't appear to be providing all the functions it used to, and it would be a good guess that it is that application that is causing the problem. Again you need to go back to the developer to get an update.
Let us know if that does not help.
Also you have posted in the Java developer forum. If this really is not your program causing the problem, then I suggest a better place to post a question relating to the 9300 is in the appropriate device forum here:
http://supportforums.blackberry.com/t5/BlackBerry-Curve/bd-p/Curve -
Help me to fix the error while running DBMaintain Against the Database Schema in ASE.
Hi All,
I am trying to install sybase mobiliser platform 5.1 SP 03.I am referring the following guide
http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01871.0513/pdf/Mobiliser_Platform_Installation_Guide_5.1…
Now I have configured the ASE database server with default settings and now it is running fine.
Now my concerns are as follows:
1) I have executed the database schema (mobr5): 001_MONEY_drop_and_create_user.DDL with the help of linux command
isql -Usa -SASE1 -Phello@123 -i/opt/sybase/db/sql/001_MONEY_drop_and_create_user.DDL -o/opt/sybase/ASE-15_0/install/ASE1.log
How do I check the created database schema and user with default name 'mobr5'?
2) While running DBMaintain Against the Database Schema, I have followed the steps mentioned in the guide and made the following changes in the file dbmaintain.properties.ase
database.driverClassName=com.sybase.jdbc4.jdbc.SybDriver
database.url=jdbc:sybase:Tds:ASE1:5000/mobr5
database.userName=mobr5
database.schemaNames=mobr5
database.password=paybox
#Must be set if the driver is not packaged inside the scriptarchive or is present on the classpath
#e.g. /path/to/driver.jar
#database.driverLocation=/path/to/jconnect.jar
database.driverLocation=/opt/sybase/db/sql/com.sybase365.mobiliser.vanilla.standalone-5.1.3.RELEASE-scriptarchive-ase.jar
database.driverLocation=/opt/sybase/db/sql/com.sybase365.mobiliser.vanilla.standalone-5.1.3.RELEASE-scriptarchive-ase-vanilla.jar
When I execute the script archives ,
java –jar /opt/sybase/db/sql/com.sybase365.mobiliser.vanilla.standalone-5.1.3.RELEASE-scriptarchive-ase-driverless.jar -c /opt/sybase/db/sql/dbmaintain.properties.ase
java –jar com.sybase365.mobiliser.vanilla.standalone-5.1.3.RELEASE-scriptarchive-ase-vanilla-driverless.jar -c dbmaintain.properties.ase
I get the following error:
So please help me to resolve the issues.Hi All,
Issue is resolved and database has been updated successfully..
Error was in database .url field of dbmaintain.properties.ase file.
I have changed the database.url field from database.url=jdbc:sybase:Tds:ASE1:5000/mobr5
to database.url=jdbc:sybase:Tds:<Private IP of Linux instance>:5000/mobr5
Note:- I am installing mobiliser platform on AWS cloud.So I have made use of Private IP address of AWS Linux instance. -
when pulling from the drop down menu for the search engines, it all comes up for the UK, not the USA.............
i reinstalled it, and then it was the romania site...lol but was able to change it back to USA from there... thanks
-
Please help me to fix the error pls-00103
create or replace procedure proc_exp is
declare
v_ename emp.ename%type;
v_sal emp.sal%type;
cursror c1 is select ename,sal from emp;
begin
open c1;
fetch c1 into v_ename,v_sal;
exit when c1%notfound;
dbms_output.put_line('ename:'||v_ename||'sal:'||v_sal);
close c1;
end proc_exp;A procedure need not have a DECLARE clause.
You are opening the cursor but not looping.
Try this
CREATE OR REPLACE PROCEDURE proc_exp
IS
v_ename emp.ename%TYPE;
v_sal emp.sal%TYPE;
CURSOR c1
IS
SELECT ename, sal FROM emp;
BEGIN
OPEN c1;
LOOP
FETCH c1
INTO v_ename, v_sal;
EXIT WHEN c1%NOTFOUND;
DBMS_OUTPUT.put_line ('ename:' || v_ename || 'sal:' || v_sal);
END LOOP;
CLOSE c1;
END proc_exp;G. -
I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can this is all new to me.
Read this: iOS 4: Updating your device to iOS 5 or later
... oh I think it is a 3gs or a 3
This makes a difference. What does it say in Settings > General > About? -
my iPod has not been working for a month now and i was hoping that you could help me.The part where you charge and sync the iPod is not connecting.There is defiantly not the lead as we use it for the iPhone and that works please could you help!
yours sincerly
jackfromsurreyWhat I am saying is ..........
The iPhone HAS to be active making calls on the UK carrier network for the carrier to identify as "theirs" and therefore eligible for the Carrier to unlock
The way to achieve this is to use a PAYG sim making and receiving calls to establish a customer relationship with the Carrier and then follow the Carrier's process to unlock
With a PAYG it usually means adding a specified (by the carrier ) amount usually £15 /£20 depending on the carrier
This is how O2 function and according to Gemma this is how Vodafone work -
Hi, I'm trying to download applications, but after I enter my ID password it's giving me window - cannot open iTunes? Please could you help me with the solution
What did you have to do? I am having the same window come up and I read all of the support trouble shooting. Still won't work.
I need help please. -
Please could you help my iphone 5 is stuck while in recovery mode, there is a USB sign and an arrow is pointing to itunes symbol, with the Itune red logo symbol
Hi Turn iPhone off Connect lead to USB on your PC Press & hold power button down on iPhone don't let go Connect lead to iPhone keep button pressed until PC sees iPhone then wait for restore . Cheers Brian
-
Mac os x . Face Time - I connect to the other person and the call futs off and ends immediately.Please could someone help? Thanks.
What version of FaceTime are you using? The current one for 10.6 is 1.0.5.
FaceTime calls after April 16, 2014 – Unable to make or receive
FaceTime Troubleshooting -
I have a Mac OS X Snow Leopard. For some unknown reason the Library application in Finder disappeared and I was using it only two days ago. Please could someone help? Thanks.
Hi cb-anc! Thank you for replying to my question. The Library application has disappeared,not the library folder. I went into the application a couple of days ago to trash some plist files and now the application has disappeared. I haven't upgraded to Lion but am still on now Leopard.
-
hello best stor in the world
my friend have problem in his system in macbook pro. after he update it. the macbook get restart every 10min. he so upset. please could you help him?
thanksthanks, but he wants this updeta.
because has many specile features not found in the old update -
Hello.. I try to make copy an audio track(AIFF-C audio) on another dvd but I can't. I was try to made an ''burn folder'' with the audio track but did burn it. Please could someone help me?
You appear to be having a hardware problem. Make an appointment at the Genius Bar of your nearest Apple Store to get a diagnosis.
-
Please, could you help with The System Error?
Hi guys,
Please could someone help me with The system error: The Parameter is incorrect? which appears on the screen when I open Adobe Photoshop?
It is Starter edition3.0 and so far it worked ok and suddenly this message haunts my screen. If I clic OK, whole application disappears. I tried hundred times and checked it is 5.1.2600 and my notebook has got Windows XP Profesional.
Any advice hunging around?
ThaaankxJThank you mark, I'll try.
J
Date: Fri, 18 Mar 2011 17:17:20 -0600
From: [email protected]
To: [email protected]
Subject: Please, could you help with The System Error?
Hi orion,
Sorry that was the impression made by the support agent. If the version of the software that you have is 3.0 or 3.2, then the catalog can be upgraded when you run the trial version of Photoshop Elements. Version 8 had no time limitations, not sure if version 9 will timeout after 30 days or not.
Just install, and when you launch, Elements will automatically convert the catalog to a format that it can read.
-Mark
> -
Please could somebody help me I have an iMac which came with Tiger 10.4.10 installed I have lost my disks and I need to re-install after a hard drive failure. Where can I find this? I will upgrade to Snow Leopard after but I cannot go straight to SL
You can go strait to SL, all you need is a retail SL DVD available from Apple for $20. The US online store has them at:
http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
Maybe you are looking for
-
How to set focus in the parent window after a JOptionPane pop up ?
I am not able to set the focus back to a JTextField in the parent window after poping up a JOptionpane.showMessageDialog(). I tried requestfocus(),requestFocusInWindow etc......but not working. The code is given below. if ((encryptor.encrypt(password
-
I am Leo and I am 6 years old. Me and Mommy went to the Apple Store in King Of Prussia Mall for 2 Hours. And I put an Apple Thunderbolt Display/Apple Cinema Display in Disk Mode. How do you get an Apple Thunderbolt Display/Apple Cinema Display out of
-
Hi All, After a successful first website, I tried to create a new one. While I've defined a gradient page background, about half of the pages show up correctly, but the other ones are missing this page background completely. Does it sound familiar to
-
I can't open older InDesign files. Can anyone help?
-
How do you get learning apps?
How do you get free learning apps from the App Store?