# Thread: Graphing with Astricks

1. Member
Join Date
Oct 2012
Posts
17
Rep Power
0

## Graphing with Astricks

I have everything done but the assignment is to also graph how many numbers of each grade there were using Astricks, Any help would be appreciated :)

//Ass5ID0000
//

public class Ass5ID0000
{
public static void main(String[] args)
{
g1 = new GradeDistribution();

System.out.println("enter how many of each grade were given, and your total will be displayed at the end");

System.out.println("how many A's were given?");
g1.setNumberOfAs();

System.out.println("how many B's were given?");
g1.setNumberOfBs();

System.out.println("how many C's were given?");
g1.setNumberOfCs();

System.out.println("how many D's were given?");
g1.setNumberOfDs();

System.out.println("how many F's were given?");
g1.setNumberOfFs();

System.out.println("here are the percentages for each grade:");
System.out.println("A = " + g1.getPerCentA() + "%");
System.out.println("B = " + g1.getPerCentB() + "%");
System.out.println("C = " + g1.getPerCentC() + "%");
System.out.println("D = " + g1.getPerCentD() + "%");
System.out.println("F = " + g1.getPerCentF() + "%");

System.out.println("here are the grades graphed out as well");
System.out.println(g1.DrawGraph());
}
}

//Assignment 6

import java.util.*;

{
Scanner keyboard = new Scanner(System.in);

public int A,B,C,D,F;
String ASTRTISK = "*";
public int index = 0;

//set number
public void setNumberOfAs()
{
A = keyboard.nextInt();
return;

}

public void setNumberOfBs()
{
B = keyboard.nextInt();
return;
}

public void setNumberOfCs()
{
C = keyboard.nextInt();
return;
}

public void setNumberOfDs()
{
D = keyboard.nextInt();
return;
}

public void setNumberOfFs()
{
F = keyboard.nextInt();
return;
}

//get number

public int getNumberOfAs()
{
return A;
}
public int getNumberOfBs()
{
return B;
}
public int getNumberOfCs()
{
return C;
}
public int getNumberOfDs()
{
return D;
}
public int getNumberOfFs()
{
return F;
}
{
return A+B+C+D+F;
}

//Draw Graph

public String DrawGraph()
{
while (index <= A);
System.out.print(ASTRTISK);
return ASTRTISK;
}

//get percentage

public double getPerCentA()
{
}
public double getPerCentB()
{
}
public double getPerCentC()
{
}
public double getPerCentD()
{
}
public double getPerCentF()
{
}

}

2. ## Re: Graphing with Astricks

Hello and welcome! Please use [code][/code] tags when posting code so we can easily read it!

Forum Rules
Guide For New Members
BB Code List - Java Programming Forum

That said, what have you tried with regard to graphing so far?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•