Write a code, taking input from User if he/she is a heart patient, has diabetes or both and subscribe medicine accordingly Diabetes- Admit , glucophage Heart Patient- Loprin, concor Diabetes + Heart Patient – Disprin and Panadol
Q: 3. Question 1 Write a python program that takes an option from the user and based on the option read…
A: print ('Choose which operation to perform : ')print ('[1] Addition \n[2] Subtraction \n[3]…
Q: Write a program that calculates the average word length in a sentence entered by a user.
A: please do upvote for mt efforts thanks! answer: if __name__ == '__main__': s = input("Enter the…
Q: Body Mass Index (BMI) is a measure ofhealth on weight. It can be calculated by taking your weight in…
A: Program code: //import the required packages import java.util.Scanner; //define a class BMI public…
Q: Print "user_num1 is negative." if user_num1 is less than 0. End with newline. Assign user_num2 with…
A: error in this line user_num2 == 1 it should be user_num=1
Q: Pet World offers a 15 percent discount to senior citizens . Write a pseudocodealgorithm for a…
A: The pseudocode algorithm is given below:
Q: PROBLEM: When creating account: It should be 6 digit pin. (if there is a letter or not 6 digits were…
A:
Q: User Prompts Your program will allow a human user to play Rock, Paper, Scissors with the computer.…
A: #Program import random def main(): print('ROCK'+'PAPER'+''+'SCISSORS'+''+'in Python') print()…
Q: Write a program which prints words of a string in reverse order for example if a user enter “I love…
A: Code: i am giving the code in java as you have not mentioned the language import java.util.Scanner;…
Q: Write an exe program that finds the sum of numbers and stops when a negative number appears by…
A: NOTE Below is the answer for the given question. Hope you understand it well. If you have any…
Q: Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham…
A: Code Screenshot :
Q: (1) Prompt the user for a string that contains two strings separated by a comma. Examples of…
A: spilt() function in Python splits a string into a list. not in key word is used to check if comma…
Q: Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex:…
A: The above question is solved in step 2 :-
Q: 4. Write a RANDOM NUMBER GUESSING GAME - • Hard code a random number as answer • Ask user for input…
A: CODE:- #include <iostream> using namespace std; int main() { int…
Q: (a) (b) Run the following codes and explain the outputs: main() { } main() { } printf ("\nC to it…
A: C programming language is the machine independent programming language which is mainly used to…
Q: Analyze the following code: int x = 0; if (x > 0) ; { System.out.println(x); } The code has…
A: Here the x has a value of 0. But in the if condition it is given that x>0, Since x=0 there the…
Q: { //print the message Sorry, we do not carry that cout> addIn; } // Write the rest of the program…
A: The correction in code has been done. The output is also attached Correct Code - #include…
Q: 22. For the following code astr . 'Hello Bob' istr - 0 try: istr - int(astr) except: istr - -1 What…
A: EXPLANATION: The variable astr is defined as the string variable in the given program code. The…
Q: (1) Prompt the user for a string that contains two strings separated by a comma. Examples of…
A: The complete code is given below.
Q: Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex:…
A: To add code segments in the below given program code, so that the code will print "Censored" if user…
Q: Write EXACTLY what is printed by t
A: Coded using Java language.
Q: A) Write a program that inputs temperature and display a message according to the following data:…
A: Program: #include <iostream> using namespace std; int main() { float temp; cout <<…
Q: Using switch write a program to insert two float numbers of and an arithmetic effect that refers to…
A: #include <iostream>using namespace std;int main(){ float a,b; char op;…
Q: What does this code print? a = True b = False c = False %3D if a or b and c: print ("Hello") else:…
A: In python, the or & and operators are used to compare two objects, The and operator evaluates -…
Q: Question 1 Write a python program that takes an option from the user and based on the option read wo…
A: Answer: Here is the code: #…
Q: Write a flowchart and pseudocode like this: Pseudocode: Start inputmyNumber Set…
A: Start input customerphoneno input customertext set bill - 5 case based on customertext case<=100…
Q: main(){ int M-20; if(M=340) cout<<M:} 20 O 40 O 21 O
A: Answer: Nothing will be printed last option i guess because its missing the first 3 options are…
Q: Calculator Challange Python Coding Create a simple calculator that takes in TWO numbers from the…
A: A Python program for the given criteria is as follows,File name : “main.py”print("Input whole…
Q: user_numbers =[] user_input = int(input()) while user_input > 0: user_numbers.append(user_input)…
A: user_numbers = [] It declare an empty list user_input = int(input()) It accept input from the…
Q: Write a code snippet that prompts the user for an integer named number and prints out “Good Number”…
A: Following is the python program that takes input from user and print Yes if the number meets any of…
Q: (1) Prompt the user for a string that contains two strings separated by a comma. (1 pt) Examples of…
A: //Java Source Code :- import java.util.Scanner; public class ParseString { public static void…
Q: A java program that works out the charges for the month. The program should accept the following on…
A: //import the required package import java.util.Scanner; //Definition of the main class public class…
Q: Print "Censored" if userlnput contains the word "darn", else print userlnput. End with newline. Ex:…
A: Hey, thank you for your question. To solve this problem, we can add a small coding snippet of…
Q: Fox International sells pre-paid calling card with the following features: Calls to USo 1.2 cents…
A: Java program to create the Fox International Calling Card Calculator.This program takes account…
Q: 8. Find the output. b1 = True b2 = False %3D b3 = False %3D if b1 or b2 and b3: print ("Hello!")…
A: Find the output of the given Python code in which three boolean variables are declared and then…
Q: Write a program that takes balance of a user's account as input.it should then ask the user how much…
A: The answer is given in next step:-
Q: rite a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: As there is no programming language mentioned so program is attempted in python language Start…
Q: Write a program that asks a user for an integer. Declare a variable num1. Let num1 = +x; Display the…
A: num1 = ++x is also written as num1 = x + 1
Q: Ask the e user for his/her hame (Tirs niddle + Last). Ask the user for his/her Birthday (year nonth…
A: We need to read in user input,after that we need to write it to a file and display it to the…
Q: What does this code print? a = True b = False %3D C = False if a or b and c: print (“Hello") else:…
A: The statement if a or b and c means if true or false and false (precedence right to left)…
Q: bool OR(int input1, int input2){ //return the logical OR of both the inputs without using the '|l'…
A: Complete the given C++ function to return the logical OR of the two given inputs. Given Function:…
Q: 26.Temperature Conversion Write a program which prompts the user for a Fahrenheit temperature,…
A: the program is written below:- print("Enter 'x' for exit."); fah = input("Enter Temperature in…
Q: Write a program to input a number x from the keyboard. If the number is larger than 0, find its…
A: #include<stdio.h> #include<math.h> int main()…
Q: echo Enter your Name: read studentnane echo Enter your First Grade: read grade1 echo Enter your…
A: echo is used to print the content on console read is used to read the contents from console Now this…
Q: Write a program that prompts the user to enter the annual income (in int) of an employee. The…
A: ** THIS CODE IS WRITTEN IN 'PYTHON' SINCE NOT PROGRAMMING LANGUAGE WAS MENTIONED. #get user input…
Q: Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex:…
A: The indexOf() method returns the position of the first occurrence of the specified character or…
Q: Write a program that takes a number from user and display the output as shown in below two runs of…
A: Given To do pattern program as sample program and input is taken from the user
Q: Using switch write a program to insert two float numbers of and an arithmetic effect that refers to…
A: According to the information given:- We have to compile the given code and find the correct option.
Q: Using switch write a program to insert two float numbers of and an arithmetic effect that refers to…
A:
Q: Write a program that prompts the user to enter twostrings and displays the largest common prefix of…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Step by step
Solved in 3 steps with 2 images
- 9. average = total/5 10 endwhile 11 print average, highest Exercise 3 Write a program for a system that checks for user authentication. The user must provide a username and password for upto three attempts. The system must check if the username exists in the system. If it exists, display a "Welcome" message. If the username is wrong display the approriate message, "Incorrect username" and allow the user to try again. If the user attempts more than three times, exit the loop and display the message "Login attempted too many times. Please contact your administrator". N.B: Assume the username and password are already pulled from external file as: Username : "XXXX" Password : 2018please write codeCreate a program that can classify a non-zero number if it is positive or negative. It also identifies if a numberis zeroand prompts the user to input another number.(C++ Language)
- Code should be correct else dislike. Please do asap.Brute force equation solver this is python program. Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y = -1 have a solution x = 3, y = 2. Given integer coefficients of two linear equations with variables x and y, use brute force to find an integer solution for x and y in the range -10 to 10. Ex: If the input is: 8 7 38 3 -5 -1 Then the output is: 3 2 Use this brute force approach: For every value of x from -10 to 10 For every value of y from -10 to 10 Check if the current x and y satisfy both equations. If so, output the solution, and finish. Ex: If no solution is found, output: No solution You can assume the two equations have no more than one solution. Note: Elegant mathematical techniques exist to solve such linear equations. However, for other kinds of equations or situations, brute force can be handy. ''' Read in first equation, ax + by = c '''a = int(input())b = int(input())c = int(input()) ''' Read in…waht is value version
- Standard Voltage Classification The Philippine Grid Code and Philippine Distribution Code define the following voltage levels: Low Voltage: a voltage level not exceeding 1kV Medium Voltage: exceeding 1 kV up to 34.5 kv High Voltage: exceeding 34.5 kV up to 230 kV Extra High Voltage: exceeding 230 kV up to 765 kv Ultra High Voltage: exceeding 765 kV (assumed) Make a Matlab program that will ask the user to input a voltage value in kV and the program will classify it according to the standard voltage classification Sample Output: >>voltlvl Input a voltage value in kV: 138 138 kV is a high voltage levelProgramming Language: Java Direction: Write a program to determine the number of PASSED and FAILED out of 15 inputted names with the corresponding grade. Restrict the inputted grade for each name in the range of 50 to 100, in which 75 is the passing grade. If the inputted grade is not on the range, the program will remind the user of a message for the accepted range for the grade and allows the user to re-enter a grade. NOTE: MUST ADD COMMENTSPlease read the question first and than only answer if you can. I will flag your answer if you will provide a wrong code.