Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds


  Asked By: Daisy    Date: May 31    Category: Java    Views: 5927

I am trying to create a program that accept
charracter from keyboard and print the result such
variables as: Quizes = .30, homework = .20, cummulative
= .30, midterm = .20 I want to write this
program to accept input(marks) for each variable and
multiply it by the corresponding constant. Then sum up the
total scores Can someone help out?



2 Answers Found

Answer #1    Answered By: Huette Miller     Answered On: May 31

To slove your problem,i don';t think it's
difficult.<br>For your first quesiton,use java.io class to get the
input which you input  from keyboard.And use some
methods to change to the form which you want.<br>Be
carefull that ,which the System.in get is a string,so you
should use ,such like parseInt,or other to chage into
the int or float.

Answer #2    Answered By: Maria Miller     Answered On: May 31

import java.io.*;public class G{public static
void main(String[] args){<br>System.out.println("Grade
is "
}<br>public static double g(String s){<br>StreamTokenizer t =
new StreamTokenizer(new
InputStreamReader(System.in));<br>try{System.out.println("Enter score for
(IOException e){System.out.println(e);}return
t.nval;}}<br><br>Now your homework is to figure out the spacing...

Didn't find what you were looking for? Find more on INPUT AND OUTPUT PROGRAM Or get search suggestion and latest updates.