• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can't figure out how to do these assignments

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone lead me in the right direction ? The assignment is due tomorrow night (2/27) at 11:59




Assignments: Students will be required to complete five programming assignments. Students will be given two weeks to complete each assignment. Four of the assignments will count towards the final grade, giving student the option to drop their lowest graded assignment.

Exams: Three exams, including the final exam, will be given. Students will be given at least one weeks notice of the exam dates. All examinations are written examinations and students are required to provide their own College Blue books for each exam. There are no make-up examinations available for any student. If a student has an excused absence exam, the grade he/she receives from the next exam will be counted for both.


Grading plan: Assignments 20%
First exam 15%
Second exam 20%
Lab 20%
Final exam 25%

>= 90 ==> A
>= 80 but < 90 ==> B
>= 70 but < 80 ==> C
>= 60 but < 70 ==> D
< 60 ==> F

Write a java program to help students to calculate his/her grade. The program will prompt user for the following inputs: assignment grades, 2 exam grades, a lab grade, and a grade of the final exam. It then calculates the weighted average and print on the screen both this value and a letter grade the student will receive. Your program should work for as many students as what user needs. The following is the sample screen display where the user inputs are underlined.

Please enter 5 assignment grades: 80 85 65 85 90
After the lowest grade is dropped, your assignment average is 85.0
Please enter 2 exam grades: 70 80
Please enter the lab grade: 100
Please enter the grade of your final exam: 70

The weighted average is:
85.0 * 20% + 70 * 15% + 80 * 20% + 100 * 20% + 70 * 25% = 81.0
You will receive B.

Do you want to calculate for another student? Please type true or false. true
Please enter 5 assignment grades: …
… // screen display for the next student

Do you want to calculate for another student? Please type true or false. false
Bye, bye!

The class that you will be writing will be called LastNameFirstNameCalculateGrades.java.

You are required to use loop and conditional statements. Grading criteria also include good documentation, descriptive variable names, and adherence to the coding convention noted on pages 1 & 2.

Your file will have the following documentation comments before the class header:

/**
@Title: LastNameFirstNameCalculateGrades
@Purpose: To practice java loop and conditional statements.
@Author: (your last first name)
@Date: (today’s date)
@Version: 1.0
*/

Question 2 (40 points): File input and output
Write a program to:
1. Input 10 fractional values from an input file input.txt. (Hint, you have to create the input.txt file yourself) ;
2. Output the sum and the average of the 10 fractional values to an output file output.txt;
Be sure to test to see if you opened the input and output files before you use them.

You are required to use file input and output class. Grading criteria also include good documentation, descriptive variable names, and adherence to the coding convention noted on pages 1 & 2.

Your file will have the following documentation comments before the class header:

/**
@Title: LastNameFirstNameFileInputOutput
@Purpose: To practice java File input and output.
@Author: (your last first name)
@Date: (today’s date)
@Version: 1.0
*/
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please explain how far you've come and where exactly you are stuck - it's hard to get you on the right track if we don't know where you are what you do or do not know.
 
LaMarkus Willins
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what i have so far, pretty sure I'm doing it wrong though.

 
Marshal
Posts: 79061
375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Your arithmetic will not work correctly because the % sign is an operator and does not give you percentages.
I think you need a Result class (or Grade or similar) where you enter the different marks and it works out the grade as a field.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you want to write this a piece at a time. If I were doing it, I'd start with this much of the spec:

Write a java program [that] prompt[s] the user for the following input: assignment grades


Literally that. Have it print to the screen the question, and nothing else.

Once you have that working, add in this piece:
Prompt for 1st grade

Note: you are not yet trying to actually GET the grades from the user. You are just printing to the screen.

Then, continue adding in a tiny piece at a time. Create a lot of methods. Separate out things that don't belong together. For example, it doesn't matter HOW you get the grades, but once you have them you should be able to pass them to a method that computes the final weighted average.

etc
 
reply
    Bookmark Topic Watch Topic
  • New Topic