c++ program that displays asterisk shapes of square, oval, arrow
and diamond that looks like the picture.
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int i=0, j=0, NUM=3,r=0, s=0, iNUM=3, x, h, k, b;
for(int co=0; co<4; co++)
{
cout <<endl<<endl;
for(int row=0; row<4; row++)
{
if((co==0 || co==4-1) || (row==0) || (row ==4-1))
{
cout << " * ";
}
else cout<<" ";
}
}
/*Oblong*/
cout<<"\n\n";
for(x=1;x<=6;x++)
{
if(x==1 || x==6)
{
for(h=1;h<=7;h++)
{
if(h==3 || h==4 || h==5)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
else
if(x==2||x==5)
{
for(k=1;k<=7;k++)
{
if(k==2||k==6)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
else
{
for(b=1;b<=7;b++)
{
if(b==1||b==7)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
}
/*arrow*/
int count = 0;
cout<<"\n";
for (int width = 0; width <= 3; width++)
{
for (int alignLeft = width; alignLeft <= 2; alignLeft++)
{
cout << " ";
}
for (int sp = 1; sp < count; sp++)
{
cout << "*";
}
cout << endl;
count += 2;
}
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
/*diamond*/
cout<<"\n";
for(r=-iNUM; r<=iNUM; r++)
{
for(s=-iNUM; s<=iNUM; s++)
{
if( abs(r)+abs(s)==iNUM)
{
cout<<"*"; }
else { cout<<" ";}
}
cout<<endl;
}
getch();
return 0;
}
c++ program that displays asterisk shapes of square, oval, arrow and diamond that looks like the...
Write an application that extends JFrame and that displays diagonal lines in a square, like those in the figure below. Save the file as JDiagonalLines.java. Output of the JDiagonalLines program
do-while 5. Write a program in C# Sharp to display the patter like a diamond.
Write a C program that does the following: • Displays a menu (similar to what you see in a Bank ATM machine) that prompts the user to enter a single character S or D or Q and then prints a shape of Square, Diamond (with selected height and selected symbol), or Quits if user entered Q. Apart from these 2 other shapes, add a new shape of your choice for any related character. • Program then prompts the user to...
Write a C program that does the following: Displays a menu (similar to what you see in a Bank ATM machine) that prompts the user to enter a single character S or D or Q and then prints a shape of Square,Diamond (with selected height and selected symbol), or Quits if user entered Q.Apart from these 2 other shapes, add a new shape of your choice for any related character. Program then prompts the user to enter a number and...
Write a Java program that prompts user to select one of the five shapes(Rectangle, Square, Triangle, Circle, and Parallelogram), then calculate area of the shape,must have input validation and uses more of java library like math class, wrapper class, string methods, use formatted output with the printf method. Finally, create a pseudo-code statement and flowchart
Write a C++ program that open the text file “numbers.txt”. (the numbers.txt looks like: ' 1. 6 8 ') Have a “output.txt” If summation of the numbers is bigger than 10, your code must write the first number inside “numbers.txt” in another file called “output.txt”. (use conditional statement for comparison)
Write a C++ program that open the text file “numbers.txt”. (the numbers.txt looks like: ' 1. 6 8 ') Have a “output.txt” If summation is less than 5, your code must write last number inside “numbers.txt” in “output.txt”, else it must write the number in between in “output.txt” (use conditional statement for comparison)
The conversion of C(diamond) right arrow C(graphite) is thermodynamically spontaneous. However, at room temperature and pressure one does not observe diamond converting to graphite. The most reasonable explanation of these data is that the conversion of graphite to diamond is rapid. spontaneity does not imply anything about the rate of reaction. diamond and graphite are at equilibrium. diamond is thermodynamically stable.
5) Write a program that prints the following diamond shape. may use (printf) statement that print either a single asterisk ( * ) or a single blank. Maximize your use of iteration ( with nested for statements) and minimize the number of (printf) statements. answer should be in simple C language please and it copyable.
In C++ using For Loops; "Write a program that displays number facts for a number provided by the end user between 1-100 in a table format that includes the number itself, whether the number is a prime number, whether the number is even or odd, whether the number is a perfect square and all of its factors. " It should also print this information.