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
Hey, anyone like will u jus help meh like pleaseee
jeyben [28]

Answer:

1

Explanation:

3 0
3 years ago
Read 2 more answers
For this project you have been asked to write a program for a local store owner. The store owner wants to keep a record of the n
elena55 [62]

Answer:

see explaination

Explanation:

#include <iostream>

using namespace std;

void display (string* name, double* purchase, int n)

{

cout<<"Name Purchase"<<endl;

cout<<"------------------------"<<endl<<endl;

for(int i=0;i<n;i++)

{

cout<<name[i]<<" "<<purchase[i]<<endl;

}

}

double calculate(double* purchase,int n)

{

double avg, sum=0;

for(int i=0;i<n;i++)

{

sum=sum+purchase[i];

}

avg=sum/n;

return avg;

}

int main()

{

int n;

cout<<"How many customer will you enter? "<<endl;

cin>>n;

string *name=new string[n];

double *purchase=new double[n];

for(int i=0;i<n;i++)

{

cout<<"Enter the customer"<<i+1<<"'s name: "<<endl;

cin>>name[i];

cout<<"Enter that customer's purchase: "<<endl;

cin>>purchase[i];

}

display(name, purchase,n);

double avg=calculate(purchase,n);

cout<<"Average purchase: "<<avg<<endl;

}

See attachment for the screenshot

7 0
3 years ago
PLS HELP ASAP ILL GIVE BRAINLKEST THANKS ITS FOR TODAY
ANTONII [103]
Do u have context for the question? Based off of my brain alone, I would eliminate good food as an answer. I’d assume the answer to the second question is code.
8 0
3 years ago
Write a C++ program to find K largest elements in a given array of integers. For eeample, if K is 3, then your program should ou
Anon25 [30]

Answer:

// C++ program to find k largest elements in the array

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int n,k;

cout<<"Enter the number of elements of array:";

// read the value of n

cin>>n;

// declare the array of size n

int arr[n];

cout<<"Enter the elements of array:";

// read the elements of array

for(int a=0;a<n;a++)

{

   cin>>arr[a];

}

cout<<"Enter the value of K:";

cin>>k;

// call the function to perform selection Sort

sort(arr, arr+n);

cout << k<<" largest elements of the array are: ";

// print k largest elements of the array

for (int i=n-1; i>n-k-1; i--)

cout << arr[i] << " ";

return 0;

}

Explanation:

Read the number of elements in the array.Then create an array of size "n" and read  n elements of the array.Sort the array in ascending array.Then Read the value of  k from user.Find the k Elements from the end of the array.This will be the k  largest elements of the array.

Output:

Enter the number of elements of array:8                                                                                    

Enter the elements of array:34 8 75 99 12 7 5 55                                                                          

Enter the value of K:3                                                                                                    

3 largest elements of the array are: 99 75 55

4 0
3 years ago
FOR PYTHON 3
VLD [36.1K]

Answer:

Complete Python code with step by step comments for explanation are given below.

Python Code:

# creating a function named scrabble_number that will take num as input argument

def scrabble_number(num):

   # print the original number  

   print("The original number is: ",num)  

   # we can implement the required logic by using python built-in functions join() and zip()  

   scrambled = ''.join([char[1]+char[0] for char in zip(num[::2], num[1::2])])  

   # print the scrambled number

   print("The scrambled number is: " + str(scrambled))  

Driver code:

scrabble_number('123456')

Output:

The original number is: 123456

The scrambled number is: 214365

5 0
3 years ago
Other questions:
  • Given non-negative integers x and n, x taken to the nth power can be defined as: x to the 0th power is 1 x to the nth power can
    7·1 answer
  • Edmund wants to create a website for his university. He has created all the necessary content and now wants to style and format
    11·1 answer
  • The PATH environment variable.
    5·1 answer
  • Which of the following tasks is least effective at preventing a computer virus?
    7·1 answer
  • Representations and Conversions
    8·1 answer
  • Your Google Search text ad has three main components. The first is a headline, and the second is a description. What's the third
    14·1 answer
  • In computer science how can you define "copyright, designs and patents act 1988"?​
    8·1 answer
  • What is the biggest problem with technology today?
    10·1 answer
  • How do I install another part on campaign call of duty cold war? please help.(best answer will get branliest.)
    15·2 answers
  • How goes design again ones attention?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!