Question

*This is meant to be done in C++ language only* *Please consider the fact that I'm...

*This is meant to be done in C++ language only* *Please consider the fact that I'm a beginner and want to be able to follow what you're doing so please write the code as simple and organized as possible. Thanks in advance.

Create a program that uses an array(one dimensional) to store the results from a poll of 30 people. Each person was asked to estimate the amount of time, in minutes, that he or she spends on Facebook each day. The program should allow the user to enter a specific number of minutes and then display the number of people spending more than that length of time. INSTRUCTIONS: Write the code by using one dimensional Arrays. Run, fix the errors..

0 0
Add a comment Improve this question Transcribed image text
Answer #1

input code:

output:

code:

#include <iostream>
using namespace std;

int main()
{
/*declare the variables*/
int time_s[30],length,count=0;
/*take input from user*/
for(int i=0;i<30;i++)
{
cout<<"Enter time of People "<<i+1<<":";
cin>>time_s[i];
}
/*take length input from user*/
cout<<"Enter the specific length:";
cin>>length;
/*count the Pepoles*/
for(int i=0;i<30;i++)
{
if(time_s[i]>length)
{
count++;
}
}
/*print the count*/
cout<<"Pepoles that are use more than that length is :"<<count;
return 0;
}

Add a comment
Know the answer?
Add Answer to:
*This is meant to be done in C++ language only* *Please consider the fact that I'm...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Note: According to the question, please write source code in java only using the class method....

    Note: According to the question, please write source code in java only using the class method. Sample Run (output) should be the same as displayed in the question below. Make sure the source code is working properly and no errors. Exercise #2: Design and implement a program (name it compareArrays) that compares the content of 2 single-dimensional arrays of the same size. The program prompts the users to enter the array size. Then prompts the user to initialize each array...

  • Please answer using C ++ programming language ONLY! We have only used <stdio.h> if that helps....

    Please answer using C ++ programming language ONLY! We have only used <stdio.h> if that helps. This is a basic course and the furthest we have gone is BASIC arrays. Write the code for the following problems using arrays. Write what would go in the “int main()” part of the program. For these problems, the entire program and program output is not needed. Just include what goes in the int main() part of the program. 1. Declare an integer array...

  • PLEASE USE BASIC C++ CODE PLEASE USE BASIC C++ CODE PLEASE HAVE DONE AS SOON AS...

    PLEASE USE BASIC C++ CODE PLEASE USE BASIC C++ CODE PLEASE HAVE DONE AS SOON AS POSSIBLE THANK YOU I REALLY APPRECIATE IT FILE TEXT: Mary 80 90 75 90 85 Joe 80 65 80 80 80 Same program as Quiz #4, but this time it must be done with arrays: Write a program that calculates the average of 5 test scores for each student on the file. Function 1--write a function to read the student's name 5 test scores...

  • needs to be written in C language. please show that code works in command prompt if...

    needs to be written in C language. please show that code works in command prompt if possible. 4. write program to take two numerical lists of the same length ended by a sen- 4. a tinel value and store the lists in arrays x and y, each of which has 20 elements. Let n be the actual number of data values in each list. Store the product of corresponding elements oflx and in a third a 2. also of size...

  • Please help with this function i'm having trouble with: must be written in c++ All of...

    Please help with this function i'm having trouble with: must be written in c++ All of the functions you must write take at least two parameters: an array of strings, and the number of items the function will consider in the array, starting from the beginning. Your implementations must not use any global variables whose values may be changed during execution. Your program must build successfully under both Visual C++ and either clang++ or g++. Your program must not use...

  • Please solve only if you know how to do it. Write the code using C++ (not...

    Please solve only if you know how to do it. Write the code using C++ (not Python or Java). Show and explain everything neatly. COMMENTS (7.5% of programming assignment grade): Your program should have at least ten (10) different detailed comments explaining the different parts of your program. Each individual comment should be, at a minimum, a sentence explaining a particular part of your code. You should make each comment as detailed as necessary to fully explain your code. You...

  • Please Use C++ Language. And Note that please donot post the answer already there Because there...

    Please Use C++ Language. And Note that please donot post the answer already there Because there is similar answer code but I need with modified Quick sort algorithm ​. Update your program from ... Create an array that holds 1000 random integers between 1-1000. Allow the user to enter an integer to search. Create and implement modified Quick sort algorithm which will sort the array before the Binary Search algorithm is executed. Create and implement a Binary Search Algorithm ....

  • Need Help Please Using Java Language Create a Code Write a class (and a client class...

    Need Help Please Using Java Language Create a Code Write a class (and a client class to test it) that encapsulates the evolution of the passwords of three students over four months. Your only instance variable should be a two-dimensional array of values representing the passwords. Dimension 1 represents the student and dimension 2 represents the month. (Since we are concerned about security, we are assuming that people change their password once a month; we only care about the value...

  • C LANGUAGE!!! The program uses both files and two dimensional arrays. The Problem Statement Business is...

    C LANGUAGE!!! The program uses both files and two dimensional arrays. The Problem Statement Business is going well for your friend, who is selling discounts to area clubs and restaurants, which means that business is going well for you! Both of you have decided that you'll advertise on memory mall, which is roughly arranged as a rectangle. There's not enough time before a football game to hand flyers to everyone arranged on the mall. Therefore, you will only be able...

  • Please code in C++! I'm not too sure what the blue box session is but I...

    Please code in C++! I'm not too sure what the blue box session is but I included it. Please help if you can 8.2: Lottery Winners A lottery ticket buyer purchases 10 tickets a week, always playing the same 10 5- digit "lucky" combinations. Write a program that initializes an array or a vector with these numbers and then lets the player enter this week's winning 5- digit number. The program should perform a linear search through the list of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT