Glenn Strong

Greenhorn
+ Follow
since Jan 27, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Glenn Strong

Carey Brown wrote:
Lines 24, 25,28, and 29 are not contained within a method. No closing brace for the class.



it kept giving me an error message every time i put a closing brace and so when i took it out thats when i got this one.
4 years ago
// ************************************************
// Positions.java Typed by: Strong
//
// Equation for a body in linear motion.
// ************************************************

import Java.util.Scanner;

public class Positions {

public static void main (String[] args)

{
Double v0 = 3.25;
Double a = -9.8;

Scanner input = new Scanner(System.in);
System.out.printf("Value for s0: ");
Double s0 = input.nextDouble();
System.out.printf("Value for t: ");
Double t = input.nextDouble();
}

{for ( Double s = s0 + (v0 * t) + ((1 % 2) * (a0 * t));
System.out.print((String)s);


Positions.java:25: error: reached end of file while parsing
System.out.print((String)s);



can anyone help me? I've tried to fix this many different ways and i still get this error message.
^
4 years ago