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
sesenic [268]
2 years ago
11

Please please help I don’t understand this please.

Computers and Technology
1 answer:
PIT_PIT [208]2 years ago
3 0

Answer:

first the class declaration (the bit with class player)

then the object creation (myPlayer = player())

then assigning a value to a property (myPlayer.life=4)

Explanation:

You have to declare the class before you can use it.

You have to create an object before you can access its members.

Unclear why in the exercise second and first are swapped...?

You might be interested in
Which part of the software hierarchy is working behind the scenes allowing programs to perform tasks?
Svetradugi [14.3K]
The right answer for the question that is being asked and shown above is that: "Currently dispatched threads." The  part of the software hierarchy is working behind the scenes allowing programs to perform tasks is that <span>Currently dispatched threads</span>
5 0
3 years ago
Write a program that asks the user to enter 5 test scores. The program will display a letter grade for each test score and an av
lana66690 [7]

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

double average(double s1, double s2, double s3, double s4, double s5){

   double avg = (s1 + s2 + s3 + s4 + s5)/5;

   return avg;}

char lGrade(double score){

   char grade;

   if(score>= 90 && score <= 100){ grade ='A'; }

   else if(score>= 80 && score <= 89){ grade ='B'; }

   else if(score>= 70 && score <= 79){ grade ='C'; }

   else if(score>= 60 && score <= 69){ grade ='D'; }

   else if(score < 60){ grade ='F'; }

   return grade;}

int main(){

   double s1,s2,s3,s4,s5;

   cin>>s1>>s2>>s3>>s4>>s5;

   double avg = average(s1,s2,s3,s4,s5);

   cout<<s1<<" "<<lGrade(s1)<<endl;

   cout<<s2<<" "<<lGrade(s2)<<endl;

   cout<<s3<<" "<<lGrade(s3)<<endl;

   cout<<s4<<" "<<lGrade(s4)<<endl;

   cout<<s5<<" "<<lGrade(s5)<<endl;

   cout<<avg<<" "<<lGrade(avg)<<endl;

   return 0;}

Explanation:

The three functions to include in the program are not stated; so, I used the following functions in the program

1. The main function

2. average function

3. Letter grade function

The average function begins here

double average(double s1, double s2, double s3, double s4, double s5){

This calculates the average

   double avg = (s1 + s2 + s3 + s4 + s5)/5;

This returns the calculated average

   return avg;}

The letter grade function begins here

char lGrade(double score){

This declares the grade

   char grade;

If score is between 90 and 100 (inclusive), grade is A

<em>    if(score>= 90 && score <= 100){ grade ='A'; }</em>

If score is between 00 and 89 (inclusive), grade is B

<em>    else if(score>= 80 && score <= 89){ grade ='B'; }</em>

If score is between 70 and 79 (inclusive), grade is C

<em>    else if(score>= 70 && score <= 79){ grade ='C'; }</em>

If score is between 60 and 69 (inclusive), grade is D

<em>    else if(score>= 60 && score <= 69){ grade ='D'; }</em>

If score is less than 60, grade is F

<em>    else if(score < 60){ grade ='F'; }</em>

This returns the calculated grade

   return grade;}

The main begins here

int main(){

This declares the 5 scores

   double s1,s2,s3,s4,s5;

This gets input for the 5 scores

   cin>>s1>>s2>>s3>>s4>>s5;

This calls the average function for average

   double avg = average(s1,s2,s3,s4,s5);

This calls the letter grade function for the 5 scores

<em>    cout<<s1<<" "<<lGrade(s1)<<endl;</em>

<em>    cout<<s2<<" "<<lGrade(s2)<<endl;</em>

<em>    cout<<s3<<" "<<lGrade(s3)<<endl;</em>

<em>    cout<<s4<<" "<<lGrade(s4)<<endl;</em>

<em>    cout<<s5<<" "<<lGrade(s5)<<endl;</em>

This calls the average function for the average

   cout<<avg<<" "<<lGrade(avg)<<endl;

5 0
3 years ago
What is the annotation method of note-taking? select one:
n200080 [17]
<span>Divides your paper into two columns: the notetaking column (usually on the right) is twice the size of the key word column (on the left).

so the answer is A
</span>
4 0
3 years ago
Firefox, you can open a link in a new tab by first ____ a hyperlink.
MrMuchimi
<span>middle-click the link (e.g., mouse scroll wheel)<span>Ctrl+click the link (Mac: Command+Click)</span></span>
8 0
3 years ago
Match the network component to its function.
Anni [7]

Answer:

where are the functions??

5 0
3 years ago
Other questions:
  • Which action will help you protect data in computer in case of an earthquake?
    11·1 answer
  • Which of the following is CORRECT about database managementsystem's languages?
    6·1 answer
  • How is the Microsoft Word 2013 window organized?
    11·2 answers
  • Carson's supervisor has asked him to review a variety of portable computers for possible purchase for their company's employees.
    13·1 answer
  • Toshiba Corporation makes computer chips. Toshiba Corporation would be classified as a A. merchandising company. B. manufacturin
    15·1 answer
  • Double bar graphs compare multiple what
    11·1 answer
  • Someone learn me more American Sign Language (ASL). Please.
    13·1 answer
  • Which of the following statements is TRUE of business intelligence (BI) systems? Business intelligence systems are primarily use
    7·1 answer
  • What does it mean to prioritize tasks?
    12·2 answers
  • Tina has taken the time to modify font sizes and colors in a text box and would like to duplicate those settings on other text b
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!