Question

Using C++, thanks!

Write a function called printAsterisks) that takes in no parameters nor returns any value, but prints 3 rows of 4 Asterisks each. HINT: Use nested loops.:) For example: Test printAsterisks ); Result Answer: (penalty regime: 0 %) 1 |Void prinAsterisks() 4

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

// Note: Highlighted code it what you asked for

#include <iostream>
using namespace std;

void printAsterisks()
{
// For 3 lines
for(int i=0; i<3; i++)
{
// for printing 4 in each line
for(int j=0; j<4; j++)
{
cout << "*";
}
cout << endl;
}
}

int main() {
printAsterisks();
}

/* OUTPUT

****
****
****

*/

Add a comment
Know the answer?
Add Answer to:
Using C++, thanks! Write a function called printAsterisks) that takes in no parameters nor returns any...
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
  • c++ language 1) Create a function that prints a greeting when called with a name such...

    c++ language 1) Create a function that prints a greeting when called with a name such as greeting ("Elona") 2) Create a function that squares a double number and returns the result as a double. 3) Create a function that takes 5 int numbers and returns the average as a float 4) Create a single function that gives a greeting, calculates the average of 5 grades but does not return a value. Hint: Use return type void and a string...

  • using c, Write a function called p4. The function takes 2 parameters, both of which are...

    using c, Write a function called p4. The function takes 2 parameters, both of which are C strings. p4 should return “true” (not 0) if the 2ndparameter is a substring of the 1st parameter, or “false” (0) otherwise. Forexample: char topic[] = “computer”; char substr[] = “put”; printf(“%d\n”, p4(topic, substr); // prints 1 substr[0] = ‘P’; printf(“%d\n”, p4(topic, substr); // prints 0 – case sensitive char s1[] = “ababcd”; char s2[] = “abcd” char s3[] = “baba”; char s4[] =...

  • 4)   Write a function named remove that returns void, takes in a string& called word, and...

    4)   Write a function named remove that returns void, takes in a string& called word, and an int called i that, starting from index 0, removes every ith letter from word by modifying it in place. Include a functional main method to make sure the program works. Programming language is C++, thanks in advance

  • Write a C++ function, smallestIndex, that takes as parameters an int array and its size and...

    Write a C++ function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. To test your function, write a main that prompts a user for a list of 15 integers and outputs the index and value of the first occurrence of the smallest value. The program should print out Enter 15 integers: The position of the first occurrence of the smallest element in...

  • Using python, create a program using nested loops to write a function called substring(s,b) that returns...

    Using python, create a program using nested loops to write a function called substring(s,b) that returns True or False depending on whether or not b is a substring of s. For example: String: "Diamond" Substring: "mond" The code will then state that this is true and "mond" is a substring of "Diamond". Example of what the program should output: Enter string: Tree Enter substring: Tre Yes, 'Tre' is a substring of 'Tree' Limitation: This program cannot use "find()" and "in"...

  • write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy....

    write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy. The function should be passed 2 parameters, as illustrated in the prototype below. int pow_xy(int *xptr, int y); Assuming that xptr contains the address of variable x, pow_xy should compute x to the y power, and store the result as the new value of x. The function should also return the result. Do not use the built-in C function pow. For the remaining problems,...

  • Using python 3.6.0 Write a function, called cubic, which takes in two parameters, say x and...

    Using python 3.6.0 Write a function, called cubic, which takes in two parameters, say x and y and computes the following formula: x3 + x + y and returns the computed value. Sample output 1: Enter x: 2 Enter y: 1 The value of the function is : 11 Sample output 2: Enter x: 1 Enter y: 3 The value of the function is : 5

  • Homework Question Write a void function called transformArray that takes two parameters - a reference to...

    Homework Question Write a void function called transformArray that takes two parameters - a reference to a pointer to a dynamically allocated array of ints, and the size of that array.  The pointer is passed by referencebecause you want to change the value of the pointer. The function should dynamically allocate an array that is twice as long, filled with the values from the original array followed by each of those values times 2. For example, if the array that was...

  • Python 1 Write a function called sum_odd that takes two parameters, then calculates and returns the...

    Python 1 Write a function called sum_odd that takes two parameters, then calculates and returns the sum of the odd numbers between the two given integers. The sum should include the two given integers, if they are odd. You can assume the arguments will always be positive integers, and the first smaller than or equal to the second. 3 To get full credit on this problem, you must define at least 1 function, use at least 1 loop, and use...

  • ****python**** Q1. Write a recursive function that returns the sum of all numbers up to and...

    ****python**** Q1. Write a recursive function that returns the sum of all numbers up to and including the given value. This function has to be recursive; you may not use loops! For example: Test Result print('%d : %d' % (5, sum_up_to(5))) 5 : 15 Q2, Write a recursive function that counts the number of odd integers in a given list. This function has to be recursive; you may not use loops! For example: Test Result print('%s : %d' % ([2,...

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