answer.
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
koban
19 days ago
11

To encourage good grades, Hermosa High School has decided to award each student a bookstore credit that is 10 times the student’

s grade point average. In other words, a student with a 3.2 grade point average receives a $32 credit. Create a class that prompts a student for a name and grade point average, and then passes the values to a method that displays a descriptive message. The message uses the student’s name, echoes the grade point average, and computes and displays the credit. Save the application as BookstoreCredit.java.
Computers and Technology
1 answer:
amid [800]19 days ago
7 0

Answer:

// here's the Java code.

import java.util.*;

// definition of the class

class BookstoreCredit

{

/* method that prints a message including the name and grade point */

   public static void fun(String name,double grade)

   {

// multiplying grade by 10

       grade=grade*10;

// display the message

       System.out.println(name+"\'s average grade is $"+grade);

   }

// main method for the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner instance to read input

       Scanner s=new Scanner(System.in);

        // declaring variables

      String s_name;

      double grade;

      System.out.print("Please enter the name:");

      s_name=s.nextLine();

      System.out.print("Please enter the grade point:");

      grade=s.nextDouble();

   }catch(Exception ex){

       return;}

}

}

Explanation:

Define a string variable named s_name and a double variable named grade. Obtain the name and grade from the user, then invoke the fun() method with these parameters, which will multiply the grade by 10 and output a message that includes the student's name along with their average grade.

Output:

Please enter the name:john

Please enter the grade point:3.2

john's average grade is $32.0

You might be interested in
As part of the duties of a digital forensics examiner, creating an investigation plan is a standard practice. Write a 3 to 4 (no
Harlamova29_29 [932]
A digital forensic investigation is a specific type of digital inquiry where methodologies and techniques are employed to enable results that can be presented in legal frameworks. This investigation might begin to ascertain if counterfeit digital images are present on a computer. For instance, Global Finance Company, which has a broad range of financial products and clients globally, finds itself in a situation where a breach has been reported involving the manager's computer. In response, a team is dispatched to the branch for the digital forensic investigation. Concerns highlighted by the company include: 1. Timely updates of application and network infrastructure. 2. A report from a branch manager in Brisbane expressing concerns of possible breaches. 3. All office servers and workstations primarily utilize Microsoft Windows. 4. Full implementation of firewalls and network segregation. 5. Although there is intrusion detection and logging across branches, their application has been neglected. The digital forensic investigation follows a structured approach comprising four phases: Collection, Examination, Analysis, and Reporting. The investigation model used proves to be effective for assessing the security incident at the regional branch. 1. In the Collection phase, data from the manager's workstation and all relevant servers must be gathered systematically. This includes identifying both internal and external storage contexts and ensuring availability of necessary forensic tools. The imaging of target computers is also crucial, along with hashing to maintain data integrity, while capturing network traffic. 2. The Examination phase involves a comprehensive analysis, comparing original data against logical copies to derive insights concerning system registry evaluations and other critical data points. Tools used for this include specific commands to assess file retrieval. 3. In the Analysis phase, various methodologies are employed, including keyword searches, file recovery, and registry data extraction, utilizing tools like FTK and ILOOKIX to access essential documents. 4. Finally, the Reporting phase concludes the investigation with the audit team generating a comprehensive report detailing the incident's summary, analyzing data, and concluding findings, while also supporting documentation with both volatile and non-volatile evidence.
7 0
11 days ago
You are a police officer trying to crack a case. You want to check whether an important file is in the evidence room. Files have
Harlamova29_29 [932]

Answer:

Since RANDY operates randomly, any file within the specified index range will have the recurrence relation as follows:

T(n) = T(n-i) + O(1)

Here, the probability is 1/n, where i can vary between 1 and n. The variable n in T(n) denotes the size of the index range, which will subsequently reduce to (n-i) in the following iteration.

Given that i is probabilistically distributed from 1 to n, the average case time complexity can then be expressed as:

T(n) = \sum_{i=1}^{n}\frac{1}{n}T(n-i) + O(1) = T(n/2)+O(1)

Next, solving T(n) = T(n/2) + O(1)

yields T(n) = O(log n).

Thus, the complexity of this algorithm is O(log n).

It should be noted that this represents the average time complexity due to the algorithm's randomized nature. In the worst-case scenario, the index range may only decrease by 1, resulting in a time complexity of O(n) since the worst-case scenario would be T(n) = T(n-1) + O(1).

3 0
29 days ago
Read 2 more answers
java methods Write a program whose input is a character and a string, and whose output indicates the number of times the charact
oksian1 [797]

Answer:

This is the JAVA code:

import java.util.Scanner; // to obtain user input

//class designed to count occurrences of a character within a string

public class CharacterCounter

//method that calculates how many times a character appears within a string

{ public static int CountCharacter(String userString, char character)

   {  

       int counter = 0;   //keeps track of the number of times the character appears in the string

for (int i=0; i<userString.length(); i++) //iterates over every character in the string

       { // if the character aligns with the one sought in the string

           if (userString.charAt(i) == character)

           counter++;  // increments the character count variable

       }  

       return counter;     } // returns the count of the character found in the string

public static void main(String[] args) {

    Scanner scanner = new Scanner(System. in);// accepts user input

    String string;

    char character;

       System.out.println("Enter a string"); // prompts the user for a string

       string = scanner.nextLine(); //captures the input string

       System.out.println("Enter a character");

       // requests the character input from the user

       character = scanner.next().charAt(0); //captures and reads the character

       System.out.println("number of times character "+character + " appears in the string " + string +": " + CountCharacter(string, character));  }  }

// calls CountCharacter method to display the frequency of a character in the input string

Explanation:

The CountCharacter() method contains a loop where index variable i traverses through each character of the string, incrementing the counter variable by 1 each time the sought character matches. This indicates that the counter maintains the tally of occurrences of the character in the string. The loop terminates when i exceeds the string length, which means the full string has been scanned for the specified character. Finally, the count variable yields the number of times the character was found in the string. The main() function receives user inputs for a string and a character to search for within that string. It subsequently invokes the CountCharacter() function to determine how many times the designated character appears in the specified string, displaying the result on the screen.

The program's output is provided in the attached screenshot.

5 0
1 month ago
Define a method calcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a d
Rzqust [894]

Answer:

The C++ method is defined as follows:

double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){

   double baseArea = calcBaseArea(baseLength, baseWidth);

   double volume = baseArea * pyramidHeight;

   return volume;    

}

Explanation:

This establishes the calcPyramidVolume method

double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){

This invokes the calcBaseArea method to derive the base area of the pyramid

   double baseArea = calcBaseArea(baseLength, baseWidth);

This calculates the volume based on the base area

   double volume = baseArea * pyramidHeight;

This yields the calculated volume

   return volume;  

}

Refer to the attached document for the complete program that includes all required methods.

5 0
24 days ago
You're installing two new hard drives into your network attached storage device. Your director asks that they be put into a RAID
8_murik_8 [892]

Response:

d. RAID 6

Clarification:

RAID is a technological method for data storage that integrates several physical hard drive components into a unified logical structure. Its primary purpose is to ensure both performance and data redundancy.

RAID 0 is focused on data striping, but it lacks redundancy.

RAID 1 enhances performance to nearly double but restricts disk space usage to around 50%.

RAID 5 offers both redundancy and improved performance, though it is constrained by smaller drive sizes.

RAID 6 provides redundancy as well but with a decrease in performance.

RAID 10 boosts both performance and data security.

Hence, RAID 6 is the optimal choice that emphasizes redundancy at the cost of speed.

8 0
1 month ago
Other questions:
  • Q) Select the two obstacles for data parsing
    5·2 answers
  • When you add a zero to the right of a decimal number, it multiplies its value by 10 (For example, "15" becomes "150"). What simi
    10·1 answer
  • 1. Orthographic Drawings are used to express ideas that are more complicated. Explain the purpose of the different views and the
    7·1 answer
  • Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin
    14·1 answer
  • A company decides to relocate its operations to another state in order to take advantage of some new business investment credits
    15·1 answer
  • What is the other name designated to a game master of multiplayer online games (MMOs)?
    11·2 answers
  • (Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20
    11·1 answer
  • The principal that users have access to only network resources when an administrator explicitly grants them is called __________
    6·1 answer
  • A wireless network does not benefit like a wired network does, when it comes to collision reduction. Which device reduces collis
    6·1 answer
  • Define a new object in variable sculptor that has properties "name" storing "Michelangelo"; "artworks" storing "David", "Moses"
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!