Help Needed! 11-04-2013, 09:12 PM
#1
Im new to java well the only reason I took it up is because of college.
if I had the choice i would stick to my prefered languages.
Ok so I have a assignment due in that i need to produce a Grading system for a tutor to grade a student
I've got the code working however im now at the stage where I want to make it look more presentable,
So essentially all I want to do is put my code in a box, i've looked on google for tutorials but can't seem to find anything
I presume im searching it right. I dont want you to do it for me I just want guidelines on how to accomplish this preferably easy task the following is my java code.
That works fine and displays the following;
![[Image: 15d2kug.jpg]](http://i41.tinypic.com/15d2kug.jpg)
but I want the code inside a box i know perfectly well how to do this in HTML and CSS it's easy;
and the CSS would be
Any ideas on how to do this in JAVA would be greatly appreciated ?
if I had the choice i would stick to my prefered languages.
Ok so I have a assignment due in that i need to produce a Grading system for a tutor to grade a student
I've got the code working however im now at the stage where I want to make it look more presentable,
So essentially all I want to do is put my code in a box, i've looked on google for tutorials but can't seem to find anything
I presume im searching it right. I dont want you to do it for me I just want guidelines on how to accomplish this preferably easy task the following is my java code.
Code:
/*
Program to allow teachers to grade students.
This program was created in java on 04/11/2013(UK DATE)
version (1.0) Created by Mediocrity
*/
import cs1.Keyboard;
public class GadingSystem
{
public static void main (String[] args)
{
String reply1;
String StudentName;
String StaffName;
int Grade1;
int Grade2;
int Grade3;
int Grade4;
int sum;
int StaffID;
//this will clearn the terminal window
System.out.print('\u000C');
System.out.println("Hello Welcome to CAVC Student grading system");
System.out.println("Please key in your staff ID");
StaffID = Keyboard.readInt();
System.out.println("Please key in your staff username");
StaffName = Keyboard.readString();
if (StaffID < 100)
{
do
{
System.out.println("Congratulations, You're Succsessfully loged in as; " + StaffName);
System.out.println("You may now grade a student");
System.out.println("what's the students name");
StudentName = Keyboard.readString();
System.out.println("Enter " + StudentName + " grade for test #1:");
Grade1 = Keyboard.readInt();
System.out.println("Enter " + StudentName + " grade for test #2:");
Grade2 = Keyboard.readInt();
System.out.println("Enter " + StudentName + " grade for test #3:");
Grade3 = Keyboard.readInt();
System.out.println("Enter " + StudentName + " grade for test #4:");
Grade4 = Keyboard.readInt();
sum = Grade1 + Grade2 + Grade3 + Grade4;
System.out.println(""+ StudentName +" scored; " + sum + " For the entire course");
if (sum > 75)
{
System.out.println("This is an Excellent result");
}
else if (sum > 50)
{
System.out.println("This is a satisfactory result");
}
else if (sum > 40)
{
System.out.println("Unfortunately more practice is needed");
}
else
{
System.out.println("Score too low to mark!");
}
System.out.println("Type Yes or yes to grade another student. Anything else quits the program");
reply1 = Keyboard.readString();
}
while(reply1.equalsIgnoreCase("yes"));
System.out.println("Thanks now, Have a nice day :|");
}
else
{
System.out.println("Sorry Your Staff ID wasn't recognised");
}
}
}
That works fine and displays the following;
![[Image: 15d2kug.jpg]](http://i41.tinypic.com/15d2kug.jpg)
but I want the code inside a box i know perfectly well how to do this in HTML and CSS it's easy;
Code:
<div class=box>
Grading System
<form method ="post" action="addMember.php">
<label for="Grade1">Enter grade for test #1</label>
<input name="Grade1"/>
<label for="Grade2">Enter grade for test #2</label>
<input name="Grade2"/>
<label for="Grade3">Enter grade for test #3</label>
<input name="Grade3"/>
<label for="Grade4">Enter grade for test #4</label>
<input name="Grade4"/>
<p>
<input name="submit" type="Submit" value="Register"/>
<input name="reset" type="reset" value="Clear Form">
</form>
</div>
and the CSS would be
Code:
.box {
background-color:#3F48CC;
color:white;
font-weight:bold;
margin:120px auto;
height:350px;
width: 400px;
}
Any ideas on how to do this in JAVA would be greatly appreciated ?
<?php echo "Very inactive at this current moment in time"; ?>
![[Image: Z8KDe.png]](http://i.imgur.com/Z8KDe.png)
![[Image: Z8KDe.png]](http://i.imgur.com/Z8KDe.png)