1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paraphin [41]
4 years ago
11

I want an A! Write a pseudocode algorithm that asks the user for their grades in CSE 1321, along with their attendance, then cal

culates their final grade. Note, perfect attendance rounds up your final grade by 1.5 points – otherwise, it’s a fraction out of 30. The tests and quiz average are worth 20% each
Computers and Technology
1 answer:
Vsevolod [243]4 years ago
4 0

Answer:

The Java pseudocode and the Java code itself are given for better understanding

Explanation:

<u>Java pseudocode</u>

  1. preAvg(int test[], int qgrade):
  2. sum := 0
  3. for each testi in test:
  4. sum := sum + testi
  5. sum := sum + qgrade
  6. return sum / 5
  7. additional(int at):
  8. res = (at * 1.5) / 30
  9. return res
  10. total = preAvg(test, qgrade) + additional(at)

<u>Java code</u>

import java.util.Scanner;

public class CSE1322 {

  public static void main(String[] args) {

     

      Scanner scanner=new Scanner(System.in);

     

      int test[] = new int[4];

     

      for(int i=1;i<=4;i++){

          System.out.println("Enter your result for test"+i+": ");

          test[i-1] = scanner.nextInt();

      }

     

      System.out.println("Enter the average quiz grade: ");

      int qgrade = scanner.nextInt();

     

      System.out.println("Enter the classes you attended(out of 30): ");

      int at = scanner.nextInt();

     

      double avg = preAvg(test,qgrade);

      System.out.println("Your average before attendance is: "+avg);

     

      double add = additional(at);

      System.out.println("You receive an additional "+add+" points for attendance");

     

      double total = avg + add;

     

      System.out.println("Final grade is : "+total);

     

  }

  private static double additional(int at) {

      double res = ((double)at * 1.5)/30.0;

      return res;

  }

  private static double preAvg(int[] test, int qgrade) {

      double sum = 0;

     

      for(int i=0;i<4;i++) sum += test[i];

     

      sum += qgrade;

     

      return sum/5;

  }

}

You might be interested in
Variables defined inside a member function of a class have: Block scope. Class or block scope, depending on whether the binary s
Snowcat [4.5K]

Answer:

The answer is "Block scope".

Explanation:

In the programming, the scope is a code, in which it provides the variable ability to exist and not be retrieved beyond variable. In this, the variables could be defined in 3 locations, that can be described as follows:

  • Inside a method or the block, which is also known as a local variable.
  • Outside of the method scope, which is also known as a global variable.
  • Defining parameters for functions known as formal parameters.
8 0
4 years ago
According to your course, two benefits of a cloud-based system are_ and_
vodomira [7]
Data backup and collaboration.
4 0
4 years ago
Which facet of the 4e framework is best addressed by thought-sharing sites?
iris [78.8K]

Educate is the facet of the 4E framework is best addressed by thought-sharing sites.

Therefore, the correct answer is Educate.

4 0
3 years ago
In case of an emergency, once you or someone already on the scene has contacted 9-1-1, the next thing to do is: A) Move them to
velikii [3]

if alone, you would give care first for which situation

4 0
4 years ago
Read 2 more answers
Which of the following peripheral devices can be used for both input and output? mouse touch screen on a tablet computer printer
sp2606 [1]

Answer:

mouse printer CPU touch screen

Explanation:

on a tablet computer hope this helps you :)

3 0
4 years ago
Other questions:
  • Maxwell says three things Level Two Leaders do well are:
    6·1 answer
  • Computer Architecture
    7·1 answer
  • In class, we discussed static local variables in C. Answereach question below; if necessary, find and consult a reference on the
    10·1 answer
  • Because many mobile devices and personal computers today are continually connected to the Internet, securing those devices again
    6·1 answer
  • In a distributed database system, the data placement alternative with the highest reliability and availability is Group of answe
    9·1 answer
  • What is the name of a button on a website?
    11·1 answer
  • Short Essay on the history of Computer​
    6·2 answers
  • Which object event is an indication that something has been created but not committed into the database?
    13·1 answer
  • The Advanced Properties sheet enables you to add which of the following?
    15·1 answer
  • The _____________computer function accepts data from input devices and sends it to the computer processor.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!