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
Genrish500 [490]
3 years ago
10

A franchise restaurant is attempting to understand if customers think their service is good day-to-day by summarizing a series o

f daily scores. The restaurant computes a daily score based on the number of positive comments and negative comments it receives that day. Each the score begins at O. A positive comment adds 1 to the score, and a negative comment subtracts 1. So on a given day if there were 5 positive comments and 2 negative comments, the score for that day would be 3 (5-2) Your task is to write a program that enables a restaurant manager to input these daily scores and report the total score for those days. For example, if the score on Monday is 3, Tuesday is 4, Wednesday is -2, and Thursday is 3, then the total score for those days would be 3+4 +(-2)+3, which is 8. This would indicate the service is being positively reviewed over the past few days. You program should prompt the user for how many days of scores they will be entering, and then prompt them for the score for each day. The score prompt should include the number of the day for which they entering a score (i.e., notice the day 1 phrase in the prompt of the example below). Once all the scores have been entered, it should then output the number total score for those days Below is an example interaction with a program correctly solving this problem: How many days of scores? 4 Enter score for day 1: 2 Enter score for day 2:4 Enter score for day 3: -2 Enter score for day 4:1 The total score of the 4 days is 5
Computers and Technology
1 answer:
Crazy boy [7]3 years ago
7 0

Answer:

C++.

Explanation:

int main() {

   int num_days_scores;

   cout<<"How many days of scores? ";

   cin<<num_days_scores;

   cout<<endl;

///////////////////////////////////////////////////////////////////////////

   // Get scores for each day and add it to array

   int score = 0;

   int* score_array = new int[num_days_scores];

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

       cout<<Enter score for day "<<i+1<<": ";

       cin<<score;

       score_array[i] = score;

   }

////////////////////////////////////////////////////////////////////////////

   // Calculate total of scores by traversing array

   int final_score = 0;

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

       final_score += score_array[i];

   }

   cout<<"The total score of the "<<num_days_scores<<" days is "<<final_score;

////////////////////////////////////////////////////////////////////////////

   delete[] score_array;

   return 0;

}

You might be interested in
Variables make it easier to do what?
defon
<span>D. Make changes to your code
Variables allow the ability to easily substitute numbers for other numbers.
</span>
8 0
3 years ago
What component can be used for user input or display of output?
kogti [31]

Answer:

JTextField

Explanation:

JTextField is a Swing control which can be used for user input or display of output. It corresponds to a textfield and can be included with other controls such as JLabel, JButton,JList etc. on a comprehensive user interface which is application dependent. JTextField supports a read-write mode where the user can enter a value and it also supports a read-only mode which can be used to display non-editable output to the user.

4 0
3 years ago
Will give brainliest and good amount of points, no false answers.
nlexa [21]

The problem with the swap function is that it loses the value at the first index, as soon as it gets overwritten by the value at the second index. This happens in the first statement. To fix it, you need a helper variable.

First you're going to "park" the index at the first index in that helper variable, then you can safely overwrite it with the value at the second index. Then finally you can write the parked value to the second index:

var swap = function(array, firstIndex, secondIndex) {

let helper = array[firstIndex];

array[firstIndex]  = array[secondIndex];

array[secondIndex] = helper;

};

I hope this makes sense to you.

7 0
3 years ago
Becuase privacy is personal customers, where should your data privacy efforts align?
Olenka [21]
With your company’s goals
5 0
1 year ago
Please help if you have the correct answer to the post test manufacturing and safety answer.
Fed [463]
I believe it is corn. ethanol can be produced from corn biomass, and is commonly used to make gasoline. i’m not sure if this answers your question, or counts as a type of energy but i tried.
8 0
2 years ago
Other questions:
  • DJ wants to see how his document will look when printed. Where would he find the button to see the document in print view? the P
    5·2 answers
  • The operations planning practice of inputting sales forecasts into computer software that accurately predicts the amount and tim
    6·1 answer
  • Why is it difficult to enforce laws against intellectual theft?
    9·1 answer
  • The correct ordering of the seven layers from "top" to "bottom" is
    11·1 answer
  • Why is weather forecast so important for hang gliders?
    12·1 answer
  • Need help fast this is do a 4
    5·1 answer
  • Dominic's teacher asked him to create a chart or graph to compare the different grade levels in the school's FBLA club. Which ch
    5·2 answers
  • Please help this is a coding assignment I need help! (use python)
    12·1 answer
  • How does an extranet work?
    15·1 answer
  • In 1972, earlier designers built the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!