Click here to Skip to main content
15,899,754 members
Home / Discussions / Java
   

Java

 
GeneralRe: Input validation loop issue - JAVA Pin
LEKnowlton6-Nov-11 1:04
LEKnowlton6-Nov-11 1:04 
GeneralRe: Input validation loop issue - JAVA Pin
Richard MacCutchan6-Nov-11 1:29
mveRichard MacCutchan6-Nov-11 1:29 
GeneralRe: Input validation loop issue - JAVA Pin
LEKnowlton6-Nov-11 2:08
LEKnowlton6-Nov-11 2:08 
GeneralRe: Input validation loop issue - JAVA Pin
Richard MacCutchan6-Nov-11 3:05
mveRichard MacCutchan6-Nov-11 3:05 
GeneralRe: Input validation loop issue - JAVA Pin
LEKnowlton6-Nov-11 12:05
LEKnowlton6-Nov-11 12:05 
GeneralRe: Input validation loop issue - JAVA Pin
Richard MacCutchan6-Nov-11 22:25
mveRichard MacCutchan6-Nov-11 22:25 
AnswerRe: Input validation loop issue - JAVA [SOLVED] Pin
Richard MacCutchan6-Nov-11 22:42
mveRichard MacCutchan6-Nov-11 22:42 
QuestionMust correct the syntactic and semantic errors Pin
Member 83667461-Nov-11 15:37
Member 83667461-Nov-11 15:37 
Hi all, I'm a relative novice at Programming. I can't figure out if I am doing this right? I am required to correct the syntactic and semantic errors in the following program:
{
public static void main(String[] args){
int x,t;
double k;
x = 56;
k = 7;
x = 6 + k;
k = x*3.5 + 5
t = t + x;
System.out.println(x);
System.out.println(k);
System.out.println(t);
}
}



This is my attempt:


{
    public static void main(String[] args){
        int t; //Added temp1 and temp2 as an integer
        double x,k,temp1,temp2; //Made x a double as program complains of loss of precision when a integer variable equals a double variable
        x = 56;
        k = 7;
        temp1 = x; //Have given old x value new variable name
        x = 6+k;
        temp2 = k;
        k = x*3.5+5;
        //t still to do
        System.out.println(x);
        System.out.println(k);

    }
}



Not really sure what I'm doing, would appreciate help. Thanks in advance all.
AnswerRe: Must correct the syntactic and semantic errors Pin
Peter_in_27801-Nov-11 17:29
professionalPeter_in_27801-Nov-11 17:29 
GeneralRe: Must correct the syntactic and semantic errors Pin
TorstenH.1-Nov-11 21:43
TorstenH.1-Nov-11 21:43 
AnswerRe: Must correct the syntactic and semantic errors Pin
TorstenH.1-Nov-11 21:46
TorstenH.1-Nov-11 21:46 
GeneralRe: Must correct the syntactic and semantic errors Pin
Firo Atrum Ventus1-Nov-11 22:28
Firo Atrum Ventus1-Nov-11 22:28 
GeneralRe: Must correct the syntactic and semantic errors Pin
TorstenH.1-Nov-11 23:01
TorstenH.1-Nov-11 23:01 
QuestionFile Explorer Pin
HTT901-Nov-11 2:12
HTT901-Nov-11 2:12 
AnswerRe: File Explorer Pin
TorstenH.1-Nov-11 21:41
TorstenH.1-Nov-11 21:41 
GeneralRe: File Explorer Pin
David Skelly1-Nov-11 23:33
David Skelly1-Nov-11 23:33 
GeneralRe: File Explorer Pin
TorstenH.1-Nov-11 23:57
TorstenH.1-Nov-11 23:57 
GeneralRe: File Explorer Pin
David Skelly2-Nov-11 2:57
David Skelly2-Nov-11 2:57 
GeneralRe: File Explorer Pin
HTT902-Nov-11 6:23
HTT902-Nov-11 6:23 
Questionjava image processing Pin
sagar lachure31-Oct-11 19:41
sagar lachure31-Oct-11 19:41 
AnswerRe: java image processing Pin
Richard MacCutchan31-Oct-11 22:41
mveRichard MacCutchan31-Oct-11 22:41 
QuestionJPanel drawing issues Pin
ExoticmE30-Oct-11 21:35
ExoticmE30-Oct-11 21:35 
AnswerRe: JPanel drawing issues Pin
Richard MacCutchan30-Oct-11 23:57
mveRichard MacCutchan30-Oct-11 23:57 
GeneralRe: JPanel drawing issues Pin
ExoticmE31-Oct-11 0:05
ExoticmE31-Oct-11 0:05 
AnswerRe: JPanel drawing issues Pin
TorstenH.1-Nov-11 21:56
TorstenH.1-Nov-11 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.