Question

c++ language

1) Create a function that prints a greeting when called with a name such as greeting (Elona) 2) Create a function that squa

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

9 #include <iostream> 10 #include<cmath> 11 12 using namespace std; 13 14 void greeting(char name[]) 15- { 16 cout<<name; 17************************************************ ** ***まま oc #include <iostream> 11 using namespace std; 12 double square(dou8 #include <iostream> 9 using namespace std; 10 float average() 11 - K int a[5], sum=0; float avg; cout<<\n Enter five numbe1 #include <iostream> 2 using namespace std; 3 void greeting grade(char name[], int g1, int g2, int g3, int g4, int g5) 4 - {1 #include <iostream> 2 using namespace std; 3 void greeting_n_times (char name[], int n) 4- { int i; for(i=0;i<n;i++) 7. couanything doubtful just comment

Thank you all the best

Add a comment
Know the answer?
Add Answer to:
c++ language 1) Create a function that prints a greeting when called with a name such...
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
  • Greeter Write a function that takes in a person's name, and prints out a greeting. The...

    Greeter Write a function that takes in a person's name, and prints out a greeting. The greeting must be at least three lines, and the person's name must be in each line. example: Hello name How are you do name Nice to meet you name Use your function to greet at least three different people. Full Names Write a function that takes in a first name and a last name, and prints out a nicely formatted full name, in a...

  • Write a C++ Program. you were required to first create a function called average. The return...

    Write a C++ Program. you were required to first create a function called average. The return type is double and it takes in two parameters, one of type string the other of type double. In the average function write a for loop that PROMPT THE USER to enter in a grade 5 times, keep a sum of all the different grades then return the average of the grades. (sum / 5) Next write a function of type double called lowest...

  • Create a class called Student. This class will hold the first name, last name, and test...

    Create a class called Student. This class will hold the first name, last name, and test grades for a student. Use separate files to create the class (.h and .cpp) Private Variables Two strings for the first and last name A float pointer to hold the starting address for an array of grades An integer for the number of grades Constructor This is to be a default constructor It takes as input the first and last name, and the number...

  • C and C++ Console Application for Student Data 1- Write a function named Average that a....

    C and C++ Console Application for Student Data 1- Write a function named Average that a. Receives two integer numbers as parameter and returns the average b. Is used in a main function. Main() stays in a loop and asks user to enter 2 numbers and then shows the average using the Average function above 2- Define a class named Student with following members: a. private data: 2 grades and a GPA (average). b. public constructor to initialize the members...

  • using c/c++ Q1 (15 Marks) Console Application for Student Data 1- Write a function named Average...

    using c/c++ Q1 (15 Marks) Console Application for Student Data 1- Write a function named Average that Receives two integer numbers as parameter and returns the average Is used in a main function. Main() stays in a loop and asks user to enter 2 numbers and then shows the average using the Average function above Define a class named Student with following members: private data: 2 grades and a GPA (average). public constructor to initialize the members a public function...

  • // This program will read in a group of test scores (positive integers from 1 to...

    // This program will read in a group of test scores (positive integers from 1 to 100) // from the keyboard and then calculate and output the average score // as well as the highest and lowest score. There will be a maximum of 100 scores. // #include <iostream> using namespace std; float findAverage (const int[], int); // finds average of all grades int findHighest (const int[], int); // finds highest of all grades int findLowest (const int[], int); //...

  • C - language please 1. Create a program that does the following, make sure you can...

    C - language please 1. Create a program that does the following, make sure you can complete this before moving to further questions, when compiling add the -Ipthread argument, if you are using gcc use the -pthread argument. Creates two threads, the first uses a function hello world() which prints hello world, the second uses a function goodbye() which prints goodbye. • Each function has a random sleep duration before printing the output - After running your program a few...

  • in C language we need to find the following : EXERCISE 3: 1. Write the definition...

    in C language we need to find the following : EXERCISE 3: 1. Write the definition of a structure named employee that contains character array members for an employee's first and last names, an int member for the employee's age, a char member that contains 'M' or 'F' for the employee's gender, and a double member for the employee's hourly salary. 2. Using the above mentioned definition, write a C program that asks a user to enter the values of...

  • Without using isdigit, create a C function that scans in a string, checks if its an...

    Without using isdigit, create a C function that scans in a string, checks if its an int, and returns the int. If the string is an integer, the function should return the int otherwise return “not a number.” i.e. if user enters “5", the function returns 5, but if the user enters “hi” the function will return “not a number."

  • Can someone fix this python program? I'm trying to do three things: Create a function that...

    Can someone fix this python program? I'm trying to do three things: Create a function that takes in a string as a parameter. Then create a dictionary of characters to integers, where the integer represents how many times the number of times the character appears in the word. Create a function that takes two lists as parameters and returns the elements they have in common of the two lists. Ask the user to create a list of numbers and keep...

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