Question

Write a program using void functions to draw a house by printing characters to the screen. . Your main should look like below

i would like a C++ program please

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

#include <iostream>

using namespace std;
void PrintIntersecting()
{
for(int i=0;i<5;i++)
{
for(int j=0;j<9;j++)
{
if(i+j==4 || j-i==4)
cout<<"$";
else
cout<<" ";
}
cout<<endl;
}
}
void PrintHorizontal()
{
cout<<"----------"<<endl;
}
void PrintParallel()
{
for(int i=0;i<5;i++)
cout<<"| |"<<endl;
}
int main()
{
  
PrintIntersecting();
PrintHorizontal();
PrintParallel();
PrintHorizontal();
return 0;
}
output:

Add a comment
Know the answer?
Add Answer to:
i would like a C++ program please Write a program using void functions to draw 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
  • In this program, you will be using C++ programming constructs, such as overloaded functions. Write a...

    In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...

  • hello please i need help ASAP QUICKLY Write down a complete C++ program that will use...

    hello please i need help ASAP QUICKLY Write down a complete C++ program that will use the following functions related with a triangle; a) a function that will let the user to input the and to return the sizes of the three sides, let say a, b, c. b) a function that will calculate and return the area of the triangle; Area=(1/2)(a+b+c) c) a function that will print the sizes of the triangle and its area on the screen. Then...

  • Lab 7: Void and Value-Returning Functions Lab 7: Void and Value-returning functions             ...

    Lab 7: Void and Value-Returning Functions Lab 7: Void and Value-returning functions              Due date: 11/6/19 Problem: Write a C++ program that calculates the areas of a rectangle and of an ellipse.                    Area = base * height             Area = π * radius a * radius b Note: all images extracted from http://www.mathsisfun.com/area-calculation-tool.html ------------------------------------------------------------------------------------------------------------------------ Your task: implement in C++ the algorithm solution shown below. ------------------------------------------------------------------------------------------------------------------------ Part A (79...

  • using repl.it can you screenshot your repl.it please Project 3. Draw a Snowman Write a program...

    using repl.it can you screenshot your repl.it please Project 3. Draw a Snowman Write a program that uses turtle graphics to display a snowman as shown below. In this program you will write numbers of functions and brings all of them under the main to draw the final shape. The functions you need are: draw_base) - This function should draw the base of the snowman, which is the large snowball at the bottom draw_mid_section () - This function should draw...

  • Write a program that inputs Celsius temperatures (use a void function), converts them to Fahrenheit (f...

    Write a program that inputs Celsius temperatures (use a void function), converts them to Fahrenheit (f = 9/5C + 32, use a value returning function) and prints whether it is a day for swimming or skiing (use a function). Include a loop in main that quits looping on -999. code in C++ please include a screen shot of the code as it is easier to read

  • Write a C++ program using user defined functions that will read in the lengths of two...

    Write a C++ program using user defined functions that will read in the lengths of two side of a right triangle and then calculate the length of the hypotenuse. The program should do this twice. The program should the following user defined functions: Function readA will read in a value for side A from the user and return it to main. (it will not receive any input data from main) Function readB will read in a value for side B...

  • Write in C. Simple Program (beginner) Assignment: Write a program Character Pointers and Functions. (like program...

    Write in C. Simple Program (beginner) Assignment: Write a program Character Pointers and Functions. (like program #5-5). Keyboard input to enter one character string. Using a single dimension array, populate the array with the character string, call a function using pointers to reverse order the character string, pass back to the main the output and total_count_of_characters. (maybe use a global variable for the total count). Print display the reversed char string and total_count. <END>

  • USING C++ PROGRAM Instructions - Part C Write a program that has three functions: All characters...

    USING C++ PROGRAM Instructions - Part C Write a program that has three functions: All characters printed should be in White ► Call the first function from main().Print "I'm in main" (as shown in example) > Print "I'm in function 1" in the first function. Call the second function. ► Print "I'm in function 2” in the second function and then ask the user to enter a float value. Enter 25 Call a third function and pass the value to...

  • Using basic c++ write 2 separate codes for this assignment. Program #1 Write a program that...

    Using basic c++ write 2 separate codes for this assignment. Program #1 Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions. • void getScore() should ask the user for a test score, store it in the reference parameter variable, and validate it. This function should be called by the main once for each of the five scores to be entered. •...

  • C programming Write the implementation for the three functions described below. The functions are called from...

    C programming Write the implementation for the three functions described below. The functions are called from the provided main function. You may need to define additional “helper” functions to solve the problem efficiently. a) Write a print_string function that prints the characters in a string to screen on- by-one. b) Write a is_identical function that compares if two strings are identical. The functions is required to be case insensitive. Return 0 if the two strings are not identical and 1...

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