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
Yuki888 [10]
1 year ago
4

write a program that records high-score data for a fictitious game. the program will ask the user to enter the number of scores,

create two dynamic arrays sized accordingly, ask the user to enter the indicated number of names and scores, and then print the names and scores sorted by score in descending order.
Computers and Technology
2 answers:
NNADVOKAT [17]1 year ago
8 0

 C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs. C++ is portable and can be used to develop applications that can be adapted to multiple platforms.

<h3> How to Create C++ Program for  High score data for a fictious?</h3>

C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs. C++ is portable and can be used to develop applications that can be adapted to multiple platforms. Performance, effectiveness, and flexibility of usage were the design pillars of C++, which was created with systems programming, embedded, resource-constrained software, and big systems in mind.

The software infrastructure and resource-constrained applications, such as desktop programmes, video games, servers, and performance-critical programmes, are two areas where C++ has been proven to be very useful.

#include <iostream>

#include <string>

using namespace std;

void initializeArrays(string names[], int scores[], int size);

void sortData(string names[], int scores[], int size);

void displayData(const string names[], const int scores[], int size);

int main()

{

 string names[5];

 int scores[5];

 initializeArrays(names, scores, 5);

 sortData(names, scores, 5);

 displayData(names, scores, 5);

return 0;

}

void initializeArrays(string names[], int scores[], int size){

 for(int i=0; i<size; i++){

     cout<<"Enter the name for score #"<<(i+1)<<": ";

     cin >> names[i];

     cout<<"Enter the score for score #"<<(i+1)<<": ";

     cin >> scores[i];

     }

}

void sortData(string names[], int scores[], int size){  

     int temp = 0;

     string tempStr = "";  

     for(int i=0; i < size; i++){

             for(int j=1; j < (size-i); j++){

                     if(scores[j-1]< scores[j]){

                             temp = scores[j-1];

                             scores[j-1] = scores[j];

                             scores[j]=temp;

                             tempStr = names[j-1];

                             names[j-1] = names[j];

                             names[j]=tempStr;

                     }

             }

     }

}

void displayData(const string names[], const int scores[], int size){

 cout<<"Top Scorers:"<<endl;

     for(int i=0; i<size; i++){

         cout<<names[i]<<": "<<scores[i]<<endl;

     }

}

                  C++ is standardized by an ISO working group known as JTC1/SC22/WG21. It has released six iterations of the C++ standard thus far and is now working on C++23, the upcoming revision. C++ was first standardised by the ISO working group in 1998 as ISO/IEC 14882:1998, also referred to as C++98. It released a revised version of the C++ standard in 2003 called ISO/IEC 14882:2003 that addressed issues found in C++98.

                  The two fundamental parts of the C++ programming language are a direct translation of hardware characteristics, mostly from the C subset, and zero-overhead abstractions built on top of those mappings. According to Stroustrup, C++ is ""C++" is a lightweight abstraction programming language that "offers both hardware access and abstraction" and is "built for creating and using efficient and elegant abstractions." Its ability to be done effectively sets it apart from other languages."

To learn more about C++ refer to:

brainly.com/question/20339175

#SPJ4

nalin [4]1 year ago
3 0

#include <iostream>

#include <string>

using namespace std;

void initializeArrays(string names[], int scores[], int size);

void sortData(string names[], int scores[], int size);

void displayData(const string names[], const int scores[], int size);

int main()

{

  string names[5];

  int scores[5];

  initializeArrays(names, scores, 5);

  sortData(names, scores, 5);

  displayData(names, scores, 5);

 return 0;

}

void initializeArrays(string names[], int scores[], int size){

  for(int i=0; i<size; i++){

      cout<<"Enter the name for score #"<<(i+1)<<": ";

      cin >> names[i];

      cout<<"Enter the score for score #"<<(i+1)<<": ";

      cin >> scores[i];

      }

}

void sortData(string names[], int scores[], int size){  

      int temp = 0;

      string tempStr = "";  

      for(int i=0; i < size; i++){

              for(int j=1; j < (size-i); j++){

                      if(scores[j-1]< scores[j]){

                              temp = scores[j-1];

                              scores[j-1] = scores[j];

                              scores[j]=temp;

                              tempStr = names[j-1];

                              names[j-1] = names[j];

                              names[j]=tempStr;

                      }

              }

      }

}

void displayData(const string names[], const int scores[], int size){

  cout<<"Top Scorers:"<<endl;

      for(int i=0; i<size; i++){

          cout<<names[i]<<": "<<scores[i]<<endl;

      }

}

C++ Programming :

               C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs. C++ is portable and can be used to develop applications that can be adapted to multiple platforms. Performance, effectiveness, and flexibility of usage were the design pillars of C++, which was created with systems programming, embedded, resource-constrained software, and big systems in mind. The software infrastructure and resource-constrained applications, such as desktop programmes, video games, servers, and performance-critical programmes, are two areas where C++ has been proven to be very useful.

                   C++ is standardized by an ISO working group known as JTC1/SC22/WG21. It has released six iterations of the C++ standard thus far and is now working on C++23, the upcoming revision. C++ was first standardised by the ISO working group in 1998 as ISO/IEC 14882:1998, also referred to as C++98. It released a revised version of the C++ standard in 2003 called ISO/IEC 14882:2003 that addressed issues found in C++98.

                   The two fundamental parts of the C++ programming language are a direct translation of hardware characteristics, mostly from the C subset, and zero-overhead abstractions built on top of those mappings. According to Stroustrup, C++ is ""C++" is a lightweight abstraction programming language that "offers both hardware access and abstraction" and is "built for creating and using efficient and elegant abstractions." Its ability to be done effectively sets it apart from other languages."

To learn more about C++ refer :

brainly.com/question/20339175

#SPJ4

You might be interested in
What is true about computer files of financial records?
Andrews [41]
Seems like you have forgotten to attach options to choose. But there are some comon statements for such type of tasks and I can recommend you to use this one : finance records should never be kept in computer files. This one is definitely <span> true about computer files of financial records.</span>Next time be more careful.
7 0
3 years ago
Read 2 more answers
Which descnptons are examples of Logistics Planning and Management Services workers? Check all that apply.
Aleksandr-060686 [28]

Answer:

The following below are descriptions of Logistics Planning and Management Services workers:

a. Lucreta supervises workers who organize the products in a warehouse

c. Beatrice sells tickets to passengers for trips, and advises them about travel routes

d.Stephane inspects vencies and equipment to make sure they meet safety standards

d. Marcel oversees the transportation activities of an organization

Explanation:

5 0
3 years ago
The Work Queue "Customer Onboarding" has a number of Pending Items which may be tagged as
BlackZzzverrR [31]

Answer:

The Correct Answer is C. Configure "Domestic + [Product Code] <> LN*" in the Tag Filter parameter

Explanation:

First, I'll split the answer into bits

Domestic -> This shows that the product belongs to a Domestic Customer

[Product Code] -> The tag [] shows that the Product Code is a generated variable that is unique to different products

<> This means Not Equal to

LN* -> Loan Product

So, [Product Code] <> LN* means Product Code is not Equal to Loan Product

Bring the whole tag together,

It means

Product Codes that belongs to domestic customer which is not Equal to Loan products

3 0
3 years ago
Write, compile, and test a program named PersonalInfo that displays a person’s name, birthdate, work phone number, and cell phon
djverab [1.8K]

Answer:

A very simple C program is as follows:

#include <stdio.h>  // for input output functions

int main()  

 {

    printf("Name : John\n");   //display name

    printf("Date of Birth : 05/02/1993\n");  //displays DOB

    printf("Mobile Number: 98-7654321\n");  //displays mobile number

  }    

Explanation:

Now if you want to take name, date of birth and number from user as input then you can use the following code:

#include <iostream> // for input output functions

using namespace std; // to identify objects like cin cout

/* The function named PersonalInfo that takes input from user and displays name, mobile number and data of birth on output screen */

void PersonalInfo(char name[],char birthdate[], char number[]){

//prompts user to enter name

cout<<"Please enter your name: "<<endl;

cin>>name; //stores name entered by the user

//prompts user to enter his dob in the format given in the bracket

cout<<"Please enter your birthdate (dd/mm/yyyy): "<<endl;

cin>>birthdate; //stores dob entered by the user

//prompts user to enter his mobile number in the given format

cout<<"Please enter your mobile number (xx-xxx-xxxxxxx): "<<endl;

cin>>number; //holds the digits entered by the user

cout<<"Your name is: "<<name<<endl; //displays name

cout<<"Your birthdate is:"<< birthdate<<endl; //displays date of birth

cout<<"Your mobile number is: "<<number<<endl; } //displays number

int main() //start of main() function body

{   char username[30],dob[30],phone[30];

/*three char type arrays that contain name of user in username, date of birth in dob and phone number in phone array */

   PersonalInfo(username,dob,phone);  } //calls function PersonalInfo()

Output:

Please enter your name: John

Please enter your birthdate (dd/mm/yyyy): 09/05/1993

Please enter your mobile number (xx-xxx-xxxxxxx): 91-123-4567890

Your name is: John

Your birthdate is: 09/05/1993

Your mobile number is: 91-123-4567890

7 0
3 years ago
The ____________ is the part of the microprocessor that performs arithmetic operations, such as addition and subtraction.
navik [9.2K]

Answer:

ALU

Explanation:

Arithmetic Logic Unit (ALU) is the part of the microprocessor that performs arithmetic operations, such as addition, subtraction, AND, OR, NOT, XOR etc. ALU is also used for comparison of input numbers.

<u>HOW IT WORKS:</u>

When the code is compiled, the code is converted first to assembly language and then assembly language is converted to machine code.

In Machine language, each arithmetic or logic operation has a specific code known as OPCODE. This opcode tells ALU which operation to perform on the inputs.

6 0
4 years ago
Other questions:
  • A type of font that has a decorative tail is A.Serif font B. Sans serif font C. Bubbles font D. Reading font
    7·1 answer
  • What is a collection?
    5·1 answer
  • If a suspect is not read his or her Miranda rights, then nothing the suspect says can be used at trial, even if the suspect volu
    11·1 answer
  • Here is free points im leaving
    11·2 answers
  • While recording a voice, if the narration is large,it is better to make a :a)a linked object b)an embedded object c)none d)does
    14·1 answer
  • Which step is first in changing the proofing language of an entire document?
    11·1 answer
  • Calculator is an example of
    14·1 answer
  • What is computer science​
    9·1 answer
  • Is this a desktop or a computer, or are they the same thing
    12·1 answer
  • Which statement will read an entire line of input into the following string object?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!