Question

Hello, I need this to be coded in C++ please. Thank you! Assume you create a...

Hello, I need this to be coded in C++ please. Thank you!

Assume you create a class called "Course PE201" that has the names (Josh T, Kevin R, Alicia M, Dimitrius J). Create a function that lists all of those names in the course.

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

Here is the solution and comments have been added for better explanation. All comments are written in bold to differentiate between the code and the comment.

//you can only enter 4 names in this function since array length is specified as 4 but you can always change it.
#include<bits/stdc++.h> //this is a header file which stores collection of multiple header files
using namespace std;

void printfunction(string names[4]) //function definition
{
for(int i=0;i<4;i++)
{

cout<<names[i];
cout<<"\n";
}
}

int main()
{

string name[4]; //array to store multiple strings


for (int i = 0; i < 4; i++)
{
cout<<"Enter name "<<i+1<<"\n";
cin>>name[i];
}
cout<<"\n\n\n";
cout<<"the list is \n";
printfunction(name); //function call

}

Add a comment
Know the answer?
Add Answer to:
Hello, I need this to be coded in C++ please. Thank you! Assume you create a...
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
  • Hello, I need help with the following Discrete problem. Please show your work, thank you! 11....

    Hello, I need help with the following Discrete problem. Please show your work, thank you! 11. Let R be the relation defined on the set of eight-bit strings by Si R 52 provided that sy and sz have the same number of zeros. (a) Show that is an equivalence relation. (b) How many equivalence classes are there? (c) List one member of each equivalence class.

  • Hello, I need help with Problem 4. Please show all the steps and the solutions of the problem. Thank you very much. 4....

    Hello, I need help with Problem 4. Please show all the steps and the solutions of the problem. Thank you very much. 4. (10 points) Compute the images of the lines it : t 0 and it: R} under the map C(z) = 2-2 IE 2+i 4. (10 points) Compute the images of the lines it : t 0 and it: R} under the map C(z) = 2-2 IE 2+i

  • Please do this in C++. Thank you in advance. Note that you have to carefully create...

    Please do this in C++. Thank you in advance. Note that you have to carefully create your class using the names and capitalization shown below. Put comments into your program, make sure you indent your program properly, and use good naming conventions. Create a class called entry. It should have two private data members of type std::string. One represents a name and the other represents an email address. Make sure you give them ,meaningful names. Create public getters and setters...

  • Hello, I need help with Problem 1. Please show all the steps and the solutions of the problem. Thank you very much. l....

    Hello, I need help with Problem 1. Please show all the steps and the solutions of the problem. Thank you very much. l. Consider the geode ie L = {it : t E R, t > 0) in 2, and consider the point i+1 which is not on L. Show that there are infinitely many distinct hyperbolic geodesics passing through w that do not intersect L. l. Consider the geode ie L = {it : t E R, t >...

  • c++ I need help! create Student.h In this class, you are provided with a class skeleton...

    c++ I need help! create Student.h In this class, you are provided with a class skeleton for the Student type. This type should contain two member variables: a string called name a vector of doubles called grades Additionally, you should declare the following functions: A constructor which accepts a single string parameter called name A void function, addGrade which accepts a single double parameter and adds it to the grades vector A function which accepts no parameters and returns the...

  • Hello, could you please help 6 A B and C. I very much appreciated Thank you...

    Hello, could you please help 6 A B and C. I very much appreciated Thank you 6 Let A be m x n and let B be m x 1. Let f : Rn R by f(x) AB. Prove that Df- A Let A be n × n with AT = A. (The rnatrix A is symmetric.) Let B be 1 × n and let c E R. Define f : Rn → R by f(x) = xT-A . x...

  • Hello, I need help with a problem for my Quantum Mechanics class. Please explain as if...

    Hello, I need help with a problem for my Quantum Mechanics class. Please explain as if I am learning for the first time. I want to be able to understand and do problems like this on my own. Thank you in advance for your help! The infinite square well has solutions that are very familiar to us from previous physics classes. However, in this class we learn that a quantum state of the system can be in a superposition state...

  • Hello. I need help writing the following Java Program. Thank you Develop a class encapsulating the...

    Hello. I need help writing the following Java Program. Thank you Develop a class encapsulating the concept of a college course, assuming that a course has following attributers: code (for instance COSC1337), a description, and a number of credits (for instance 3). Include a constructor, the accessors, mutators and methods ‘toString’, ‘equals’, and ‘finalize’. Write a client class to test the behavior of the class and its methods. The outline of the class is given as follows: public class Course...

  • Hello, this assignment was solve in c++ but I need it in Python programming please please please....

    hello, this assignment was solve in c++ but I need it in Python programming please please please. and also the speudocode as well. thank you.. Problem: Your company wants to give out prizes to the first ten people in line at a sale. In order to give out the prizes, the winners names and email addresses are to be captured. When ten names and email addresses are entered, the list of winners is to be displayed. Sample Output: Winners of...

  • Hello all, I need an expert in organic chemistry to help with this practice question. Please...

    Hello all, I need an expert in organic chemistry to help with this practice question. Please give answer the question below. Please explain your answers for each drug separately. Please I need your honest answer to this question. Thank you. The question is as stated below; Hello all, I need an expert in organic chemistry to help with this practice question. Please give answer the question below. Please explain your answers for each drug separately. Please I need your honest...

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