Write a program that computes a final grade

Assignment Help JAVA Programming
Reference no: EM131125450

Computation

Write a program that computes a final grade, as specified in the course outline using the six term marks: assignments, project, tutorials, quizzes, midterm and final exam.

https://people.scs.carleton.ca/~mjhinek/COMP1406/

The six term marks will be provided to the program via command line arguments (values passed to the program when you run the program from the console window in DrJava) and will always be given in the same order: A, P, T, Q, M, F.

Starting with the skeleton program provided, Grades.java, add code to the computeGrade and roundGrade methods so that the program outputs to standard output (System.out) the correct final grade. Do not change the main method. Your program will output a single line with the computed final grade rounded to exactly one decimal place. The grades provided from the command line can be integers or decimal numbers (all are given as a percentage). To allow for possible bonus marks, valid percentages can range from 0.0 to about 105.0. The roundGrade function will take a double and return a string that represents that number rounded to exactly one decimal place.

Add comments, whitespace, and indentation to the code so that the entire file (Grades.java), not just the functions you are completing, follows the style guide. Marks will be deducted if you do not follow the style guide.

Testing: Create and submit another program called GradesTesting, that tests your Grades program. For each test case, your program should display the input (grades), the expected output of your program and the actual output. For example, a single test case might look like

String[] input = {"75.1", "30", "45.1", "77", "65.2", "72.3"};
System.out.println("Test 0: " + input);
System.out.println(" Expected answer is 65.2");
System.out.print(" Answer obtained is "); ← note the change
Grades.main(input); ← note the change

Your testing program should also follow the style guide. In particular, be sure you describe (in comments) each test case (or group of test cases). The expected and actual output should line up nicely on the screen.

2: Grade Conversion

In the provided Convert.java file, complete the method called convertToLetter. The interface (specification) of the method is given below.

public static String convertToLetter(double grade)
/* Purpose: converts a given numerical grade to a letter grade *
* Input : a number *
* output : the letter grade (F, D-, D, ..., A+) corresponding to the *
* input grade if the input is valid, "Invalid" otherwise */

The conversion table is given as follows

Output

Input Range

A+

[90, 100]

A

[85, 90)

A-

[80, 85)

B+

[77, 80)

B

[73, 77)

B-

[70, 73)

C+

[67, 70)

C

[63, 67)

C-

[60, 63)

D+

[57, 60)

D

[53, 57)

D-

[50, 53)

F

[0, 50)

Invalid

other

Note that the range [a, b) means any number x such that a ≤ x < b. That is, square brackets mean inclusive and parentheses mean exclusive.

3: Longest Streak

In the provided Problem3.java file, complete the method called longestStreak. There should be no other methods or attributes in your class. The contract (specification) of the method is given below.

public static int longestStreak(boolean[] values)
/* Purpose: computes the length of a longest streak of consecutive *
* true occurrences in the input argument values *
* Input : values is a non-null array of booleans with length at least 1 *
* output : outputs the maximal number of consecutive trues found in *
* the input array */

Do not change the method signature (use the provided skeleton java file). Changing the method modifiers, return type, name or input arguments will result in zero correctness marks for this problem.

5: Tic-Tac-Toe

In this problem you will write a program to play tic-tac-toe against a computer. Tic-tac-toe is a game that is played on a 3 × 3 grid. We will label each of the 9 grid elements using the following convention

1

2

3

4

5

6

7

8

9

See https://en.wikipedia.org/wiki/Tic-tac-toe if you are unfamiliar with the game.

Write a program called TicTacToe. You will write this game using concepts of procedural programming (not object oriented programming). Your program should behave as follows:

- Your main method will drive your game by calling other static methods in your class. The overall control flow of your game will be in main but the details of the different actions will be in other static methods.

- Particular tasks should have their own method.

- You will use Scanner objects for user input. You may use String objects. You may use array objects. Your program should not use any other objects.

- Your program will let a user play as many games as they like, until they decide to stop playing. (You must ask the user if they wish to play another game after each game has ended. The expected answers to this question will be yes or no, and be case insensitive).

- Your game must be (relatively) user friendly. That it, it must provide useful prompts to the user during the game. It should say when a game has ended and who won, etc.

- You may assume that all input is valid. When asking for a position to play, the user will always enter a single number between 1 and 9 (inclusive). When asked to play another game, the user will always enter yes or no (or Yes, YEs, yES, nO, NO, etc.).

- Your game must play a valid game of tic-tac-toe. If the user specifies a location is that already taken, an appropriate message must be displayed and the user must be prompted to try again.

- The playing grid should be displayed showing the current state of the game. You should redraw the game after each computer move (so that the user can see what the board looks like).

Reference no: EM131125450

Questions Cloud

Working capital management : •What are the benefits of just-in-time (JIT) techniques?•What types oforganisations use JIT techniques?•Should things change if they are running smoothly?
Determine the due date of the note : Northrop Supply Company received a 30-day, 6% note for $40,000, dated September 23 from a customer on account.
What family will the molecule then belong to : If the H from the OH group in CH3-OH is removed and replaced with a METHYL group, what family will the molecule then belong to?
Describe how you would graph this line : Describe how you would graph this line using the slope-intercept method. Be sure to write in complete sentences. Please help i have more questions and i gotta get my grade up to move on
Write a program that computes a final grade : COMP1006/1406 - Summer 2016 - Write a program that computes a final grade, as specified in the course outline using the six term marks: assignments, project, tutorials, quizzes, midterm and final exam.
Determine the maturity value of the note : Cannondale Supply Company received a 120-day, 9% note for $200,000, dated March 13 from a customer on account.
Common stock with a market value : Global Pistons (GP) has common stock with a market value of $200 million and debt with a value of $100 million. Investors expect a 15% return on the stock and a 6% return on the debt. Assume perfect capital markets.
What do we mean when we say a venture is insolvent : What do we mean when we say a venture is insolvent?
How much would the last grading period be worth : If you made all A's all the way through, how much would the last grading period be worth? Create an equation to represent any grading period along the way

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd