Results 1 to 5 of 5
Thread: help me with my code
- 12-04-2016, 04:10 PM #1
Member
- Join Date
- Dec 2016
- Posts
- 4
- Rep Power
- 0
help me with my code
So I'm new at JAVA , I'm trying to make an program to calculate my grade on an specific class .
Heres the code:
Java Code:import java.util.Scanner; public class nota { public static void main (String [] args){ Scanner sc = new Scanner(System.in); String name; String surname; float test1; float test2; float test3; int provimi; // FINAL TEST int grade; System.out.print("Name of student: "); name = sc.nextLine(); System.out.print("Surname of student: "); surname = sc.nextLine(); System.out.print("How much % has the student on the first test?: "); test1 = sc.nextFloat(); if (test1>15){ System.out.println("Student can't get more than 15% in the first test!!"); } System.out.print("How much % has the student on the second test?"); } }
I don't care if the program calculates my grade good or wrong I just want to make some practice and experimenting with code .
I think the code to do what I'm asking is "while" and true and false but I dont understand "WHILE" so good .
Thank youLast edited by cybershark; 12-04-2016 at 06:21 PM.
- 12-04-2016, 04:19 PM #2
Re: help me with my code
Moved to New section.
What problems are you having with your code? If errors or wrong results, copy the console's contents and paste it here to show us what the program is doing.
Please edit your post and wrap your code with code tags:
[code]
**YOUR CODE GOES HERE**
[/code]
to get highlighting and preserve formatting.
Note: It be useful for anyone reading the code if the description of what you want the code to do was included in the source code as comments. Then the description and code would all be in one place.Last edited by Norm; 12-04-2016 at 04:23 PM.
If you don't understand my response, don't ignore it, ask a question.
- 12-04-2016, 06:20 PM #3
Member
- Join Date
- Dec 2016
- Posts
- 4
- Rep Power
- 0
- 12-04-2016, 06:21 PM #4
Member
- Join Date
- Dec 2016
- Posts
- 4
- Rep Power
- 0
Re: help me with my code
I dont have any erros . I'm just asking how can I do something
- 12-04-2016, 09:21 PM #5
Re: help me with my code
Ok, I'm looking in the code to see what it is supposed to do and don't see any comments describing anything.
until the answer is right .Last edited by Norm; 12-04-2016 at 09:30 PM.
If you don't understand my response, don't ignore it, ask a question.
Similar Threads
-
Posting code to forum : Code to code tags
By rushtojess in forum Suggestions & FeedbackReplies: 2Last Post: 04-21-2015, 09:16 PM -
this code is not working I Dont know why ? Public void close the last code!!
By lukote04 in forum New To JavaReplies: 1Last Post: 03-25-2012, 04:40 AM -
I want the source code of DUK's Bank , the example code in Java EE 5 Tutorial 2010
By zahra in forum New To JavaReplies: 16Last Post: 01-31-2012, 09:36 PM -
servlet include method copying sorce code and executing source code as output how to
By shamkuma2k in forum Advanced JavaReplies: 0Last Post: 08-07-2011, 09:32 PM -
C server code - Java CLient Code _ TCP Connection Problem
By rmd22 in forum NetworkingReplies: 0Last Post: 02-21-2011, 12:50 PM
Bookmarks