Write a shell program to do the following. a. Do the following for 3 students b. Get name, age, gender for all the 3students as input. c. For all 3 children - Check if "age" is between 1 to 14 (display as (display as "Teens") or greater than 19 (display as “Adult"). d. Display the name, age, gender for all the 3 students.
Q: Write a program that takes the user age and prints the following: Print too old, if age is greater…
A: Use if else if statements to check all the conditions one by one
Q: Write a program that prompts for and reads the radius and the height of a cylinder (in centimeters).…
A: Answer : Here is the C++ code: //included header file #include<iostream> //included namespace…
Q: Exercise 1: Write a Python program that reads from the input screen n city names and temperatures…
A: Required:
Q: - Write a program to compute the mass flow rate of a fluid (in kg/sec) through a thermal unit…
A: Dear learner , Hope you are doing well , I will try my best to answer this question. Thank You!!
Q: Write a program that reads from the user a character ('q' or 'c'). • i the character is 'c', the…
A: Since the programming language is not mentioned, we'll do it in python. The programming methodology…
Q: Exercise 3. Use the program shell below to implement a program called SumDigits. When completed,…
A: #include <iostream>using namespace std; int main(){ int counter; //loop-control…
Q: write a program that displays, in ascending order,the first names of those students who have…
A: Step 1:- In the question does not show in which language write the program therefor above program…
Q: 6-Write a PYTHON program that takes a date as input and outputs the date's season in the northern…
A: According to the question below the solution: Output:
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: The answer to the following question:-
Q: This is a debugging problem that I am completely stuck on. This is the question - The files provided…
A: Introduction of Program: In this program, The user will press 1 for Burger, 2 for Hotdog, 3 for…
Q: Write a program that does the following:
A: According to the question we need to solve:
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, q3 = 3 located at…
A: For the given points (1, 2, 3), (3, -4, -5) and (-4, 2, -6) The rij is the distance between charges…
Q: Write a C++ program that generates a plate number based on the user’s answer to the following…
A: Step 1 : Start Step 2 : In the main function, declare and initialize the number plate string with…
Q: Write a program that computes and assesse the tuition fee of the students in one semester, based on…
A: Algorithm: 1. Start. 2. Read the tuition fee as tuition_fee. 3. Read payment mode (Press (1) - Cash,…
Q: Write a Python program to accept student ID, student name, marks in two quizzes (each quiz out of…
A: Program Approach: Create 2 empty lists q_marks and a_marks for storing the marks obtained by a…
Q: Write a program that reads the name, the gender (F/M) and age of the user and checks if he can go…
A: Create 3 variables (String)name, (int) age and (char) gender. Take input name from user and store in…
Q: write a program in VB that requires from user to insert the total number of students and the number…
A: ' Program that reads total student and successful student and calculate' and display percentage of…
Q: Write a program that does temperature converter :\n", "- The user will enter if he wants the result…
A: As per the requirement program developed. Note: In the question programming language is not…
Q: Let's modify the program from this section so that the user can supply the interest rate. For very…
A: Step 1: Declare a constant to store initial balance. Step 2: Declare and initialize year to be 0.…
Q: Write a program to read two integers with the following significance. The first integer value…
A: Required: Write a program to read two integers with the following significance. The first integer…
Q: Write a shell program to do the following. a. Do the following for 3 students b. Get name, age,…
A: Algorithm: Start Read age, name and gender of three students in 3 arrays Iterate through the arrays…
Q: What is the output of the following code: name = ['joe', 'soap', 'john', 'doe'] for i in name:…
A: In this there are no change in name list In for loop there is no change in for loop in output print…
Q: Write a program that shows the following output
A: #include <stdio.h> int main(){ // prompt user for input printf("enter n=\n"); int n;…
Q: Write a program c++ that receives the date from the user in the form of 3 correct numbers, the…
A: Lets see the solution.
Q: Solve in Python: Write a program that creates a login name for a user, given the user's first name,…
A: Here I have taken input from the user and stored it into 3 different variables. Next, I have…
Q: 9) Write a program that reads a temperature value and the letter C for Celsius or F for Fahrenheit.…
A: According to the question below the solution: Output:
Q: 13. Write a program that lets the user play Rock-Paper-Scissors against the computer. There should…
A: Since no programming language is mentioned, I am using python Algorithm: Start Read input from user…
Q: Write a program which takes two float numbers from the user and check, if first number is greater…
A: Algorithm: Start Read 2 float numbers m1,m2 if the first number is greater add 5 in the first…
Q: Write a program that receives a number from a user and checks if it's float or integer. In case of…
A: First we declare the number variable, which gets input from the user. Also, we declare a variable…
Q: Write a program that creates a login name for a user, given the user's first name, last name, and a…
A: Textual Python Code :- firstName = input ("Enter first name :")lastName = input("Enter last name :…
Q: Write a program which takes two float numbers from the user and check, if first number is greater…
A: The user has not given the language to answer . I have give the answer in C++ . Please run and give…
Q: Write a code using C++ for the given prompt: A contractor orders, say, 30 cubic yards of premixed…
A: #include <cmath> #include <iostream> using namespace std; int main() { double…
Q: Using function calls, write a program to spell out the word MISSISSIPPI using block letters like the…
A: PROGRAM CODE: public class Main{ public static void main(String[] args) { printM(); printI();…
Q: Consider the program below, what is the output of the code when the value of x = 10?
A: The answer is
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: The two inputs are char and float. Code is either H, C, or I. This is input to the switch statement.…
Q: Write a program to find out the grade of a student based on the marks obtained in three subjects.…
A: As the programming language is not mentioned so, I am using C language to write a code. If you want…
Q: c++ to store the roll no. (starting from 1), name and age of 5 students and then print the details…
A: Create a class studnt with private roll_no, name and age variables. Declare a get() method to get…
Q: Write a program that will ask a user to input grades in Integral Calculus, Computer Programming and…
A: Given Code : integral_calc = float(input('Input your grade in Integral Calculus: '))phys =…
Q: Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per…
A: Note: In this question the coding language is not specified then we are doing this question in the…
Q: Write a C++ program that will prompt for and read in the names (first and last) and the final exam…
A: C++ program to prompt the user to enter the first and last names and the final exam scores of a…
Q: 4. Write a program which to find the grace marks for a student using switch. The user should enter…
A: /****************************************************************************** Welcome to GDB…
Q: Write a program that inputs values of type char, short, int, & long the values in union variables of…
A: the code is as follows:-
Q: Write a program that asks users when their birthday is. Use information provided to give them their…
A: Your solution is here with an output.
Q: Write a shell program to do the following. a. Do the following for 5 students b. Get name, age,…
A: Arrays in Shell programming: An array holds multiple data together in consecutive memory locations.…
Q: Write a program which takes two float numbers from the user and check, if first number is greater…
A: program: #include <iostream> using namespace std; int main(){ float m1,m2;…
Q: Write a program which will work for the following equation and store the output in memory. x = (x -…
A: Given equation is, x=(x-1)2+(y-1)2 The Algorithm for the given function is: Start Enter the value…
Q: Write a program which prints the following message exactly in the output screen by using in and \t…
A: The program prints the output format using tab character(\t) and newline character(\n) In a…
Step by step
Solved in 2 steps with 3 images
- Implement using python progeam 1) The Variables used here are as followes B : True if there is a Baseball Game on TV, False if not G: True if George watches TV, False if not C: True if George is out of Cat Food, False if not F: True if George feeds his cat, False if not. Let us say you are given some Training Data which represents what happens over a period of time (For example: This file contains what happens every evening over one specific year). Your Task is to learn the conditonal probabilty tables for the bayesian network from the training data. The training data will be formatted as follows: The first number is 0 if there is no baseball game on TV (B is false), and 1 if there is a baseball game on TV (B is true). The second number is 0 if George does not watch TV (G is false), and 1 if George watches TV (G is true). The third number is 0 if George is not out of cat food (C is false), and 1 if George is out of cat food (C is true). The fourth number is 0 if George does not feed…Three numbersa. Write a program that reads three numbers and prints “all the same” if they are allthe same, “all different” if they are all different, and “neither” otherwise.b. Write a program that reads three numbers and prints “increasing” if they are inincreasing order, “decreasing” if they are in decreasing order, and “neither”otherwise. Here, “increasing” means “strictly increasing”, with each value largerthan its predecessor. The sequence 3 4 4 would not be considered increasing.c. Repeat part b. but before reading the numbers, ask the user whetherincreasing/decreasing should be “strict” or “lenient”. In lenient mode, thesequence 3 4 4 is increasing and the sequence 4 4 4 is both increasing anddecreasingConsider records of employees each consists of employee's first name (string), number of hours worked (int)and hourly rate in Bahraini Dinar BD. (double).Write a program that reads from the user multiple records for multiple employees and displays the following onscreen:(a) the salary for each employee (Salary = Hours Worked x Hourly rate.)(b) the number of employees(c) the highest salary with employee name.Reading records of employees should stop when the user enter `stop' for the employee name. Sample I/O of theprogram is shown in the example below.
- f. A laborant in a laboratory does a number of antigen tests in one day. Write a program that simulates the number of antigen tests done in a day in a laboratory, displays the number of positives and negatives, and calculates the % of positives in one day. Your program needs to first generate a random number that will show the number of tests done in a day. One laboratory in a day cannot do more than 100 tests and less than 1 (they do at least one). Then for each of the tests, your program needs to generate a random number to show whether they are positive or negative. In order to write this program, you need to have the following three functions used by the main function: test result (void): This function generates a test result. It should randomly return either one or zero. 1 means positive test result and 0 means negative test result. float positive percentage (int,int) : This function takes the total number of positives and the total number of tests and returns the % of positives.…6. A palindrome is a number or text phrase that reads the same backwards or forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads a 5 digit integer and determines whether it is a palindrome. Hint: One way to do this is to use division (/) and modulus (%) operators to separate the number into individual digits.Write a program that take 5 digit number as an input from the user and perform the following tasks:1. Split a number into digits.2. Find the sum of the all the digits in the number.3. Find the product of the all the digits in the number.4. Find maximum number with in the number along with position.5. Printing the digits in the reverse order.Note: Make user defined functions to perform each task.
- 1. Write a pyrhon program that prints out a classic hangman stick figure. The program should ask the user to enter a number from 1-6 and the corresponding hangman should be printed. The value the user inputs corresponds to the number of incorrect guesses in a real hangman game and so the completeness of the hangman will correspond to the number of ‘incorrect guesses’ inputted by the user (e.g., if the user enters 1, then only the head of the hangman will be printed; full example below). Example:Enter a number from 1-6: 1O Enter a number from 1-6: 2O|Enter a number from 1-6: 3O\||Enter a number from 1-6: 4O\|/|Enter a number from 1-6: 5O\|/|/Enter a number from 1-6: 6O\|/|/ \ 2. Modify your program from problem 1 so that the user input is checked to be a validsingle digit (1-6) before printing the corresponding hangman. If the input is not valid, theninstead of a hangman the following message should be printed “Invalid input: you must enter asingle number from 1-6.” Example:Enter a…Program 2: Write a program that asks the user for a word or phrase. Check to see if it is a palindrome. A palindrome is a word that is spelled exactly the same forward and backwards such as radar or noon. Your program must also take case into account. If the user types Radar, it must still return that it is a palindrome. Do not worry about palindromes with spaces. You do not need to put any code in static methods, you do not need to worry about try/catch blocks, and you do not need to make the program run more than once. Test values that I will use in class: Noon palindrome tacocat palindrome Hello not a palindrome in javaPython please: Write a program that creates an upward-pointing arrow. Choose 2 input characters: one for the arrow's body and one for the arrow's head, then print an upward-pointing arrow. For example, if the input is * - the output is ---------********* Note: There are two spaces preceding row one (the tip of the arrow). There is one space preceding row two. There are no spaces preceding row 3. There is one space preceding each of rows 4, 5, and 6 (the body of the arrow).
- Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient the following data should be entered: • The number of days spent in the hospital• The daily rate• Charges for hospital services (lab tests, etc.)• Hospital medication charges.If the patient was an out-patient the following data should be entered:• Charges for hospital services (lab tests, etc.)• Hospital medication charges.Use a single, separate function to validate that no input is less than zero. If it is, it should be re-entered before being returned.Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out- patient data. Both functions should return the total charges.Implement the following two functions: // Returns true if all the sides of the triangle // are same. bool isValid(double side1, double side2, double side3) // Returns the perimeter of an equilateral triangle.double perimeter(double side1) The formula for computing the perimeter is perimeter = 3 * side. Write a test program that reads three sides for a triangle and computes the perimeter if the input is valid. Otherwise, display that the input is invalid.Write a program that displays every integer between 1 and 100 that is divisible by 5 or 7, but not both. Write it using While and for.