CODE OF THE FOLLOWING PROGRAM:-
#include <stdio.h>
#include <stdlib.h>
int main()
{
char choice;
int j=1,num;
//if J is less than equal to 9
while(j<=9){
printf("Input an integer number\n");
scanf("%d",&num);
//if number entered is less than j or greater than 20. User will
enter again
while(num<j || num>20){
printf("Number must be greater or equal to j and less or equal than
20,enter input again\n");
scanf("%d",&num);
}
//Menu & asking user to enter a choice
printf("Choose one of the following menu\n");
printf("X: print '*' num times\n");
printf("Y: print '#' num times\n");
printf("Z: Exit from the program\n");
scanf(" %c",&choice);
//If the entered choice is not x,Y or Z enter again
while(choice!='X' && choice!='Y' &&
choice!='Z'){
printf("Wrongly enter,enter again\n");
scanf(" %c",&choice);
}
//If the entered choice is X,Y or Z do as per menu
if(choice=='X'){
//If user choice is X
for(int i=0;i<num;i++)
printf("*");
printf("\n");
}
else if(choice=='Y'){
//If user choice is Y
for(int i=0;i<num;i++)
printf("#");
printf("\n");
}
else if(choice=='Z'){
// Terminate if user choice is Z
exit(0);
}
}
return 0;
}
SCREENSHOT OF THE PROGRAM AND SAMPLE OUTPUT:-

SAMPLE
OUTPUT:
HAPPY
LEARNING
Activity 16-02 With proper indentation and comments, With proper interface/menu on the monitor Write C program...
Note: You must write this program in Python. General Requirements The program should display a menu and allow the user to perform one of the following tasks. Add an item to the list Delete an item from the list Print the list Print the list in reverse Quit the program The program should run until the user chooses to quit. In Python, programmatically quitting the application is achieved with the exit() procedure. You should use a List to store the...
Objectives: Integer arithmetic, Functions, menus. Write a C++ program that displays the following menu of choices. 1. Find the number of digits in an integer. 2. Find the nth digit in an integer. 3. Find the sum of all digits of an integer. 4. Is the integer a palindrome? 5. Quit Enter a choice: Page 1 of 4 For each of the choices (1, 3, 4), Read a positive integer number and call a function that processes the menu choice...
Subset Sum-2 Write an algorithm (in comments) and specify the big O, and a C program to solve the problern below. Read the input for the set elements, the value of K from the user. Assume the size of the set is not bigger than 20. Subset Sum-3 Write an algorithm (in comments) and specify from the user. Assume the size of the set is not bigger than 20 1. Given a finite set of integers, is there a subset...
Write a C++ program that will display the following menu and work accordingly. A menu that will display the following choices and uses functions to carry out the calculations: 1. Call a function named classInfo() to ask the user the number of students and exams in a course. 2. Call a function getGrade() that will get the information from classInfo() and asks the user to enter the grades for each student. 3. Call a function courseGrade() to display the average...
Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve the following program. -Use Microsoft Visual C++ .NET 2010 Professional compiler using default compiler settings. -Use Microsoft Visio 2013 for developing your flowchart. -Adherence to the ANSI C++ required -Do not use <stdio.h> and <conio.h>. -Do not use any #define in your program. -No goto statements allowed. Upon execution of the program, the program displays a menu as shown below and the user is prompted to make a selection from the menu....
Answer in C using basic C and loops.
ASSIGNMENT: Write a program that will display how many times a ball will bounce until its height is less than 1 inch. A ball has a property called the coefficient of restitution, a number between 0.0 and 1.0, that indicates how 'bouncy' the ball is. A coefficient of restitution of .5 means that the ball will bounce-up 50% of its initial height after each bounce Write a program to ask the user...
Write a full C++ program Assignment4_SequenceSum that prints terms of the following mathematical sequence: ( also written as ) Your program should accept a real number from the user representing a limit, and should add and print terms of the sequence until the sum of terms meets or exceeds that limit. For example, if your user enters 2.0, program prints terms until the sum of those terms is at ≥ 2.0. You should round your answer to...
Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your pseudocode and C-program, use only what you have learned in this class so far. (Menu) Design a menu for question 2 and 3. So far, you use one program to solve all lab questions. But some of you may feel awkward when you want to demo/test only one lab question. To overcome that, your program should show a menu so that the users of...
Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....
In C language using printf and scanf statements: Write a program to display a histogram based on a number entered by the user. A histogram is a graphical representation of a number (in our case, using the asterisk character). On the same line after displaying the histogram, display the number. The entire program will repeat until the user enters zero or a negative number. Before the program ends, display "Bye...". The program will ask the user to enter a non-zero...