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
Vika [28.1K]
2 years 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:
Ad libitum [116K]2 years ago
7 0

Answer:

// here is code in java.

import java.util.*;

// class definition

class BookstoreCredit

{

/* method that display descriptive message with name and grade point */

   public static void fun(String name,double grade)

   {

// multiply grade with 10

       grade=grade*10;

// print the message

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

   }

// main method of the class

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

{

   try{

    // scanner object to read innput

       Scanner s=new Scanner(System.in);

        // 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:

Create variable s_name of string type and grade of double type.Read the student name and grade from user.call the fun() with these two parameter, where grade is multiplied by 10 and print the descriptive message which has student name and echoes the grade point average.

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
The OSI security architecture provides a systematic framework for defining security attacks, mechanisms, and services. True or F
Alex Ar [27]

Answer:

True is the correct answer for the above question

Explanation:

  • The OSI security architecture is a security framework that is used to secure the data packets when it is going to transfer on the internet for communication.
  • It is used to define the security rules and mechanism which need to secure the data packets.
  • It mainly focuses on Security services, Security attacks, Security mechanisms.
  • The above question-statement states about the framework which defines the security mechanism to secure from the attacks are known as OSI Security architecture which is the correct statement which is described above. Hence True is the correct answer.
3 0
2 years ago
The function below takes two arguments, a dictionary called dog_dictionary and a list of dog names (strings) adopted_dog_names.
laiz [17]

Answer:

The solution code is written in Python.

  1. def removeAdoptedDog(dog_dictionary, adopted_dog_names):
  2.    for x in adopted_dog_names:
  3.        del dog_dictionary[x]
  4.    
  5.    return dog_dictionary  
  6. dog_dictionary = {
  7.    "Charlie": "Male",
  8.    "Max" : "Male",
  9.    "Bella" : "Female",
  10.    "Ruby": "Female",
  11.    "Toby": "Male",
  12.    "Coco": "Female",
  13.    "Teddy": "Male"
  14. }
  15. print(dog_dictionary)
  16. adopted_dog_names = {"Ruby", "Teddy"}
  17. print(removeAdoptedDog(dog_dictionary, adopted_dog_names))

Explanation:

Firstly, let's create a function <em>removeAdoptedDog() </em>takes two arguments, <em>dog_dictionary </em>& <em>adopted_dog_names</em> (Line 1)

Within the function, we can use a for-loop to traverse through the <em>adopted_dog_names</em> list and use the individual dog name as the key to remove the adopted dog from <em>dog_dictionary </em>(Line 3). To remove a key from a dictionary, we can use the keyword del.

Next return the updated dog_dictionary (Line 5).

Let's test our function by simply putting some sample records on the <em>dog_dictionary</em> (Line 7 -15)  and two dog names to the <em>adopted_dog_names list</em> (Line 19).

Call the function <em>removeAdoptedDog() </em>by<em> </em>passing the <em>dog_dictionary and adopted_dog_names </em>as arguments. The display result will show the key represented by the<em> adopted_dog_names</em> have been removed from the <em>dog_dictionary </em>(Line 21).

4 0
2 years ago
Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j
Lelu [443]

Answer:

see explaination

Explanation:

def words2number(s):

words = s.split()

numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']

result = ""

for word in words:

if word in numbers:

result += str(numbers.index(word))

return result

4 0
2 years ago
Read 2 more answers
Consider the following class:
levacccp [35]

Answer:

Option c is the correct answer for the above question.

Explanation:

  • The super is a keyword in java which is used to call the parent class constructor from the child class constructor, but the only one thing is important to write the super is the constructor that the super keyword needs to be written as a first-line where it is used.
  • The above question has three option which holds the constructor, in which option 1 and 2 holds the super keyword as the last line. So this option is not to hold the correct constructor.
  • But option 3 will hold the Super as the first line, Hence this is the correct use of the constructor.
  • And Only option c states about option 3 while the other is states about the other option. Hence option c is the correct answer.
4 0
2 years ago
Cleo finds herself frequently searching for messages from particular senders or with specific subjects. What should she create
blsea [12.9K]

Answer:

The element she can create to increase efficiency for these searches is:

Search Folder

Explanation:

The reasons behind this are that index in the first place indexes by themselves don't facilitate the job of looking quickly at a certain e-mail. Because they show the user all of them. Second, outlook rules are certain guidelines that the user can program to group certain emails and send them to certain folders. However, they don't play a crucial part in quick searches. We have two options that could make this: instant search of folder search. Instant search works by general categories, of emails, events, and contacts. But search folders give the user certain characteristics the emails can have so the user can choose which emails to see. Thus, this is the correct answer.

8 0
2 years ago
Other questions:
  • Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
    6·2 answers
  • If Mark is developing a website to be optimized for mobile devices, what would be the top-level domain?
    10·1 answer
  • Now that the classList Array has been implemented, we need to create methods to access the list items.
    5·1 answer
  • Nathan would like to save his PowerPoint presentation as a video that can be replayed easily on any device at full quality. Whic
    14·1 answer
  • Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
    13·1 answer
  • Which of the following best describes the protocols used on the Internet?
    12·1 answer
  • In this first journal assignment, you will explore the role of testing in the SDLC. You will explain the role and importance of
    9·1 answer
  • Describe how a cell’s content and format attributes are related.
    13·2 answers
  • Consider the following code segment, which is intended to create and initialize the two-dimensional (2D) integer array num so th
    15·2 answers
  • You are an IT manager at Gigantic Life Insurance. You have a new desktop support person starting today whose experience is limit
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!