Write a program to print the hollow diamond of stars (*), ask the user to enter an odd number as the height. For example, if user enters height as 7, output will look like:

#include <iostream>
using namespace std;
int main()
{
int n ;
cout<<"Enter the n value: ";
cin >> n;
for (int i = 1; i <= n ; i += 2) {
for (int j = 0; j < n - 1 - i / 2; j++)
cout<<" ";
for (int j = 0; j < i; j++)
if(j==0 || j==i-1){
cout<<"*";
}
else {
cout<<" ";
}
cout<<endl;
}
for (int i = n-2; i >=1 ; i -= 2) {
for (int j = 0; j < n - 1 - i / 2; j++)
cout<<" ";
for (int j = 0; j < i; j++)
if(j==0 || j==i-1){
cout<<"*";
}
else {
cout<<" ";
}
cout<<endl;
}
return 0;
}
Output:

Write a program to print the hollow diamond of stars (*), ask the user to enter...
In Python, write a program that asks the user for a positive integer number. If the user enters anything else, the program would ask the user to re-enter a number or enter -1 to quit. If it is a positive number, the program then prints out a multiplication table that goes up to that number. For example, if the user enters 10, the output would look something like this. https://www.vectorstock.com/royalty-free-vector/multiplication-table-on-white-background-vector-2721686
Using python for this programming Factorial Ask the user to enter an integer number. Then print the factorial of that number Write a program to print the below ******** (note: 8 stars) ******* ****** ***** **** *** ** * Ask the user to enter the speed of their car. Write an if-else statement that displays “Speed is normal” if the speed variable is within the range 24 to 56. If speed variable is outside this range it should display “speed...
using python3
Write a Python program that will ask the user for: 1. The length of a rectangle. 2. The width of a rectangle and will print out the length of the diagonal of the rectangle. So your program should look like this: Please enter the length of the rectangle: Please enter the width of the rectangle: The diagonal of the rectangle is: So the user enters the length, width and then the answer is printed.
Write a complete C++ program to ask the user to enter 4
integers. The program must use a function
to find the smallest integer among them and print it on the screen.
Typical output screen should be as following:
Write a complete C++ program to ask the user to enter 4 integers. The program must use a functionto find the smallest integer among them and print it on the screen. Typical output screen should be as following: Note: the code...
In Java
Write a program that will ask the user for integers and print if the integer is positive, negative or zero. The program should continue asking for integer until the user enters a negative value.
(Java) HELP! Create a program that will ask the user to enter their first name and their favorite number. Ask the user if they would like the information repeated back to them. If they type "Y" display the answers back to them. If they type anything else, display the word "Goodbye". An example of what your output window should look like is below. The system-generated output is in red. The user-provided input is in green. (Your actual program will only...
Write a program which asks the user to enter an integer. Use switch statement to write out the numeric word (such as ONE) if the user's input is 1; (see the sample run output for the usr input 2 or 3); otherwise, write OUT OF RANGE. Below are few sample runs: If the user enters a 1, the program will print: ONE TWO THREE Or, if the user enters a 2, the program will print: TWO THREE Or, if the...
Python Programming 4th Edition: Write a program that asks the user for the number of feet. The program converts those feet to inches by using the formula ’12 * feet’. Hint: Define main () program Get the number of feet from the user Define variables Call a function feet_to_inches(feet) The function receives the number of feet and returns the number of inches in that many feet. The output should look like as follows: Enter the number of feet: If the...
Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * * * * * * * **...
Write a complete C++ program to ask the user to enter 4 integers. The program must use a function to find the LARGEST integer among them and print it on the screen. Typical output screen should be as following: Note: the code must contain function to find the LARGEST number. Enter four integers 1 2 4 0 Largest integer is 4