GPA And Average Program
Mar 25, 2014
I am new on this and I will be working in a gpa and average program. This is my code so far: Every time that I try to add the gpa part it gives me errors or just duplicates whatever I've in average and displays it in gpa
/**
* This program shows a database of students in a school.
* It gathers information as name, classes, grades, and calculates average and gpa average.
*
*/
import javax.swing.JOptionPane;
[code]....
View Replies
ADVERTISEMENT
Sep 28, 2014
I am doing a program that has a weighted average calculation and everything compiles and runs. It is just that my weighted average seems to be calculating incorrectly.This is the type of output I should see:
Homework:
Number of assignments? 3
Assignment 1 score and max? 14 15
Assignment 2 score and max? 16 20
Assignment 3 score and max? 19 25
Sections attended? 4
Total points = 65 / 80
Weighted score = 40.63
Exam 1:
Score? 81
Curve? 0
Total points = 81 / 100
Weighted score = 16.2
Exam 2:
Score? 95
Curve? 10
Total points = 100 / 100
Weighted score = 30.0
Course grade = 86.83
Below is my code and I think even after getting up this morning and looking at it, I have an error in the calculations, but I can;t pinpoint it.This program is supposed to receive input from user, and calculated the grades of a student with a weighted average
import java.util.Scanner;
public class Grades{
private double weightExam;
private double score;
private double curveAmount;
private double scoreTotal;
[code]...
View Replies
View Related
May 9, 2010
I am having a problem with my program. I can't get my program to calculate properly. Everything compiles and run but its just giving me a wrong answer. I am suposse to get 115.50 but instead I am getting .30...
order.java
public class Order
{
double salesTaxRate; //initializing a variable for the sales tax rate.
double subTotal; //initializing a varliable for the sub total.
double shippingCost; //initializing a variable for shipping cost.
double salesTax; //initializing a variable for sales tax.
double totalCost; // initializing a variable for totale cost.
[Code] ....
View Replies
View Related
Mar 27, 2015
I just have not got the chance to spend much time on it lately I know a bit but I'm not an expert or even intermediate with Java so I'm trying to make a program where the teacher enters the grade of each student and its stored in a variable the only problem is if I use a for loop the variable in which the result will be stired will be overwrite by the last repetition of the loop,I think the idea would be a nested loop but how I would go about using it in this situation,
here is my java code.
import java.util.Scanner;
class maths{
public static void main(String[] args)
[Code].....
View Replies
View Related
May 5, 2015
I am writing a program using a given test drive... I am supposed to write two classes according to the test drive. The calculated correct answer should be 115.50 but i keep getting 115.52 instead and i just can't figure out what i'm doing wrong.
Here is the test drive code:
import java.text.NumberFormat;
public class FinalTester
{
public static void main(String[] args)
{
double avgPurchase;
Order[] lastYear = new Order[4];
[Code] ....
View Replies
View Related
Jan 12, 2015
I have a question. How to write a progamme which compensates an average if it is less than a 10/20. I use eclipse and database HSQLDB. I have a table with notes. After the compensates, I must change the note in my database.
I have three notes
12, 11, 5
The average is 12+11+5/3=9,33
I take the lowest note: 5
12+11+x/3 = 10
12+11+x/3 = 30/3
x=30-23
x=7
The new average is 12+11+7/3=10
View Replies
View Related
Jun 16, 2014
I'm working on a homework assignment and I keep getting a compiler message this is the message
GradesAverage.java:44: error: variable totalgrade might not have been initialized
System.out.println("Over all you have " + totalgrade);
^
1 error
The homework is this Write a program that has variables to hold three test scores. The program should ask the user to enter three test scores and then assign the values entered to the variables. The program should display the average of the test stores and the letter grade that is assigned for the test score average. Use the grading scheme in the following table:
Test Score Average Letter Grade
90-100 A
80-89 B
70-79 C
60-69 D
Below 60 F
This is my code
import javax.swing.JOptionPane; // Needed for JOptionPane class
import java.util.Scanner; // Needed for the scanner class
public class GradesAverage
{
public static void main (String[] args)
[code]....
View Replies
View Related
Apr 13, 2014
I keep getting an error that says variable can't be found, what am I missing?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import java.util.Scanner;
public class testscores extends JFrame
[code]...
View Replies
View Related
May 21, 2015
For some reason, the averages aren't calculating correctly. I'm aware I need to convert to double if I'm dividing by an odd amount but that itself isn't the issue. It's just simple easy divisible numbers that are not being calculated correctly. For instance, (10 + 10 + 10 + 50) / 4 = should be 2 but I get 10.
Here is the code:
import java.util.Scanner;
public class Avg {
public static void main(String[] args){
Scanner inputGains = new Scanner(System.in);
int userInput = inputGains.nextInt();
[Code] ....
View Replies
View Related
Jan 28, 2015
package Program1;
import java.util.Scanner;
public class Source1 {
[Code].....
using netbeans to debug the program but i'm not sure what I did wrong as it doesnt go past test 1
View Replies
View Related
Oct 9, 2014
I'm trying to write a program that will output the total number of large,medium,and small pizza along with the average cost of an order. I'm stuck on this error , "Else without if" on line 48 else ...medium.
import java.util.Scanner;
public class PizzaOrder
{
public static void main(String[] args)
{
Scanner input = new Scanner (System.in);
double cost,total, average;
String name,response,size,type;
int count,l,m,s;
[code]....
View Replies
View Related
Jun 11, 2014
You are to write a parallel program that will receive a large array of unsorted integers containing digits from 0 to 99. The program will have to calculate the SUM and AVERAGE of ODD number digits between 25 and 75 (inclusive). The user may specify the size or the array and the total processor that the machine has. The size of the array must be divisible by number of processor. Based on the given size, the computer will generate random integer numbers automatically to populate the array.
The program should display the status of the calculation for each processor. The result should be displayed after all calculations are completed.Error messages should be displayed appropriately
a) Write a sequential (non-parallel) program that will accomplish above task.
b) Write a concurrent (parallel) program that will produce the result of the above task.
View Replies
View Related
Nov 23, 2014
I have written a simple grade average program. This is my code:
package programs;
import java.util.Scanner;
public class GradeAverage {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int number;
int counter = 0;
int grade;
[Code] ....
Now the program is working just fine but what I don't like about it is the fact that you have to enter the number of grades before entering the grades. What I would prefer is to write your grades, hit some button that is reserved for calculating the average and then get the output.
View Replies
View Related
Oct 4, 2014
I wasn't supposed to use the % in front of f.I have to make a program to calculate the average temperature and annual precipitation in Jacksonville. I get this error on line 49:
java.util.IllegalFormatPrecisionException;
null (in java.util.Formatter$FormatSpecifier)
I don't get any errors during compilation.Here is my code (I'm not using the system selection yet):
import java.util.Scanner;
public class AnnualClimate1
{
public static void main(String[] args)
{
double[] temperaturesInJacksonville = {53.1, 55.8, 61.6, 66.6, 73.4, 79.1, 81.6, 80.8, 77.8, 69.4, 61.7, 55.0};
[code]....
View Replies
View Related
Oct 26, 2014
My homework assignment is: Using a do-while statement, write a Java program that continuously requests a grade to be entered. If the grade is less than 0 or greater than 100, your program should display an appropriate message informing the user that an invalid grade has been entered; a valid grade should be added to a total. When a grade of 999 is entered, the program should exit the repetition loop and compute and display the average of the valid grades entered. Run the program on your computer and verify the program using appropriate test data.
When I run it, I don't get the correct average. I know that i'm supposed to enter 999 to exit the loop and to display the average, but 999 is being added with the loop. I'm not sure how to make it not do that.
//stephanie
import java.util.Scanner;
public class gradeAverage
{
public static void main(String[] args)
[code]....
View Replies
View Related
Apr 2, 2015
Four experiments are performed, each consisting of six tests. The number of test results for each experiment is entered by the user. Write a Java program using a nested loop to compute and display the average of the test results for each experiment.
You can run the program by entering the following test results:
Experiment 1 results:23.231.516.927.525.428.6
Experiment 2 results:34.845.227.936.833.439.4
Experiment 3 results:19.416.810.220.818.913.4
Experiment 4 results:36.939.549.245.142.750.6
View Replies
View Related
Mar 9, 2014
I am to design a program in java that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas. I have tried but my results are wrong.
View Replies
View Related
Dec 30, 2014
I'm having trouble compiling this program. It is supposed to compute the average of the sum:
import java.util.Scanner;
public class ComputeAverage
{
public static void main(String[] args) {
Scanner bucky = new Scanner(System.in);
double fnum;
double snum;
[Code] ......
View Replies
View Related
Apr 22, 2014
In the class, you will have three instance variables,
1) array to hold the numbers,
2) the odd average, and
3) the even average.
The constructor should accept as input the array from the tester class and assign it to the instance variable. You should then have a method, findAverage, that will read the array and then calculate the average of the even input values and the average of the odd input values. (Hint: You can use % (mod) to determine if a number is even or odd). Your program will need a getOddAverage and a getEvenAverage method.
public class oddEvenAverage {
int [] myArray = new int[10];
public double oddAverage;
public double evenAverage;
public oddEvenAverage(int number){
int myArray = number;
[Code] .....
What am i doing wrong here? I can't get it working!
View Replies
View Related
Apr 21, 2014
I'm trying to calculate the average of grades that a user puts in. Here is my code so far:
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("Please enter an array of grades seperated bt a comma.");
input.nextLine();
String arrayOfGrades = "100,50,100";
String[] grades = arrayOfGrades.split(",");
[Code] .....
I think I'm on the right track, the only big error I'm really getting is the line: sum += grades[i]. It's saying string can not be converted into a double.
View Replies
View Related
Apr 21, 2014
I'm struggling with this assignment I was given:
Given list of positive integer values, write a program to calculate average of the values. List terminates with -1.
View Replies
View Related
Nov 19, 2014
I am trying to write a code that asks the user to enter a temperature for each day of the week and then it prints out the high temperature, the low temperature, and the average temperature. This is the code I have so far:
import java.util.*;
import java.text.DecimalFormat;
public class Lab10 {
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
int high, low, i, sum;
double avg;
[Code] ....
There are a few issues that I am having.
1. I can't for the life of me figure out how to make it print the low temperature
2. I had it running perfectly until I changed one thing and now I get a compile error saying that the last 5 statements are unreachable. (lines 32-37)
View Replies
View Related
Jan 25, 2014
How to create a simple program that can input number from 1 to n. and display the numbers which input by the user and also display the sum and average of it.
Ex.
Please input a number:
1 2 3 4 5 6 7 8 9 10
the sum numbers of 12345678910 is 55
the average number of 12345678910 is ______,
View Replies
View Related
Dec 7, 2014
For my project, I am trying to return the method average so the program can calculate the average after grades are enter. I'm not sure what I am doing wrong and how I should improve it. My code is below. This is my error message: "Project.java:71: error: '.class' expected".
import java.util.Scanner;
public class Project
{
public static void main(String[] args)
[code]....
View Replies
View Related
Dec 7, 2014
I have make a simple grade average project and can't figure out how to ask the user if they want to enter more grades to average and run the app again.Here's what I have so far.
import java.util.Scanner;
public class Average {
private static Scanner kb;
public static void main(String[] args) {
kb = new Scanner(System.in);
[code]...
How many grades do you wish to average?
View Replies
View Related
Apr 21, 2014
This program will not give me the average high temperature for the week and I cannot figure out why! Every time it only spits out "0" whereas the average low temperature works great..
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Temps_Grid_Keenan extends JFrame
{
private static final long serialVersionUID = 1L;
private static final int WIDTH = 400;
private static final int HEIGHT = 500;
private JTextField high1Field, low1Field, high2Field, low2Field;
private JTextField high3Field, low3Field, high4Field, low4Field;
private JTextField high5Field, low5Field, high6Field, low6Field;
private JTextField high7Field, low7Field, ave_highField, ave_lowField;
[code]....
View Replies
View Related