Write a single statement to print: user_word,user_number. Note that there is no space between the comma and user_number.Sample output with inputs: 'Amy' 5 Amy,5
Q: What is the output produced by the following code? int result = 11; result /= 2;…
A: Given, Code snippet: int result = 11;result /= 2;System.out.println("resu lt is " + result); The…
Q: Consider the following function in answering the questions below. int a, int b, int c; int temp; if…
A: There are two parts in this question, In first part we are asked to develop test input to cover 100%…
Q: Write a single statement to print: user_word,user_number. Note that there is no space between the…
A: Please find the answer below
Q: Give an output statement that produces the letter 'A', followed by the newline character, followed…
A: Newline character and tab character are special symbols so we need to use an extta slash.
Q: Write a program segment using switch selection for the following statements. If the grade is A,…
A: Program code: #include <stdio.h>int main(){ char ch='B'; switch (ch) {…
Q: identify the suitable output statement from the following to show the value of CV and SV in C++. CV…
A: identify the suitable output statement from the following to show the value of CV and SV in C++.…
Q: 2.2 Write a program that uses input to prompt a user for their name and then welcomes them. Note…
A: Given : Write a program that uses input to prompt a user for their name and then welcomes them. Note…
Q: Question 1: Write a C program that do the following: A Ask the user to enter his grade as (A, B, C,…
A: Below is the required code in C language. Approach to Program: Include necessary header files to…
Q: Write a VB.NET program to input number from user and check number is palindrome or not
A: Given: To check whether the given number is palindrome or not using VB.NET
Q: 2. Complete the function avg5 to return the average of five numbers. Use the accumulator pattern.…
A: # Function to calculate the average of 5 numbersdef avg5(num1,num2,num3,num4,num5): #…
Q: What is the output of the given program below if the inputted value is 2 #include #include void…
A: Code : Output :
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: 3. OUTPUT Enter Any Value to Proceed: (any value) Enter Two Values Enter A whole number: (whole…
A: Given input and output format for writing program, Enter Any Value to Proceed: Enter two values…
Q: Rewrite the following program using if statements without the switch statement char alpha;…
A: Store the lower character in alpha variable by writing alpha=tolower(alpha) Three conditions using…
Q: Write the result of the each of the following output statement in the space provided below. 1 int…
A: Given:
Q: Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a…
A: Program Approach-Import the essential java packages.Declare the class named Main.Define the main…
Q: Thank you so much for the prompt reply. However, this code is not working. I"m getting an error…
A: Answer the above program are as follows:
Q: 3. Indicate the output int i, j, sum; sum = 0; for (i = 1; i < 5; i++) sum += ar1 [i, 4 - i];…
A: Note: “Since you have asked multiple questions, we will solve the first question for you. If you…
Q: Problem: Read your name and one numeric value [Omani Rial], print the following menu as shown in…
A: Algorithm- Take input of name, value in Omani rials. Then take input of choice and use switch case…
Q: C. Explain the result of the operations of the following two statements i) PORTB = PORTB I 0x04; ii)…
A: Answers are given below about PIC MICROCONTROLLER in C
Q: Create expression for each of the following output. You may use unary or binary operators or…
A: According to the Question below the Solution:
Q: Write the input statement to get float input from the user with a prompt message as "Enter Float…
A: Given Write the input statement to get float input from the user with a prompt message as "Enter…
Q: Write the result of the each of the following output statement in the space provided below. 1 int…
A: Line number Result 2 -3 3 -2 4 19 6 19
Q: Write two statements to read in values for my_city followed by my_state. Do not provide a prompt.…
A: current_time = '2014-07-26 02:12:18:'my_city =''my_state = ''log_entry =''my_city = input()my_state…
Q: Write two Get statements to get input values into birthMonth and birthYear. Then write three Put…
A: Since you are not mentioning the programming language. We are using C++ to complete the above…
Q: Given int x=3, y=4; Write a statement to print the addition result of x and y in two lines in a…
A: //statement to print addition result in message boxJOptionPane.showMessageDialog(new…
Q: Analyze the following statements and predict the output. Each statement is assumed the continuation…
A: The solution to the given problem is below.
Q: Question 1: Write a C program that do the following: Ask the user to enter his grade as (A, B, C, D,…
A: Include an appropriate header in the C program such as stdio.h. stdio.h is a C header file that…
Q: Write two statements to read in values for my_city followed by my_state. Do not provide a prompt.…
A: In the given problem we need to write a program including log_entry with the current_time, my_city…
Q: Given the following code segment, write the output exactly as it would appear. Write the exact…
A: Here, we are going to check the exact output for the given code segment for (x = 7; x < 0; x--)…
Q: 5. Fill in the blanks from the given choices, to display the incremented value of variable temp.…
A: To print a message to the console, we utilize the WriteLine strategy for the Console class. The…
Q: Show the output from the following function and call: def f(d) : print ('First', d) if d < 10 :…
A: StartFirst 16Not Done 16First 14Not Done 14First 12Not Done 12First 10Not Done 10First 8DoneCall:…
Q: Question # 10: Write a program to print the following output: BBBBBBBBB BBBBBBB BBBBB BBB
A: Step 1: Program Approach: These are instructions related to the code:- (i)Declare four…
Q: Read the following code segment and sample output to complete the empty blanks in the code segment.…
A: import java.util.*;public class Main { public static void main(String[] args) { Scanner keyIn =…
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: Problem: Read your name and one numeric value [Omani Rial], print the following in below output,…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: 3 نقاط This code print hello five times with the sequence of each word * .using Do While statement…
A: Module VBModule Sub Main() Dim i As Integer i=1 do…
Q: Write 2 different programs using if statement and switch statement that will ask the user which…
A: #include<stdio.h>int main(){ double firstN, secondN; char ch; printf("Enter the…
Q: %% [0-9] printf("number"); [a-zA-Z] printf("letter"); T+EN+ printf("10"); According to…
A: In lex rules, for some input string output is given according to the first matched rules. And…
Q: Given a line of text as input, output the number of characters excluding spaces, periods,…
A: 1. input a string 2. set the counter to 0 3. now iterate over the string 3.1 if the current…
Q: Write a statement that assigns total_coins with the sum of nickel_count and dime_count. Sample…
A: Here total_coins=0 create a variable to hold total count of coins nickel_count=int(input())…
Q: Run the following code and explain the difference of the results with comments (each operation step…
A: Postfix expression a-- indicates that the value of a will be decremented by 1 after the evaluation…
Q: Write a statement to add the key Tesla with value USA to car_makers. Modify the car maker of Fiat to…
A: Statement to add key and update value of the key using python code
Q: Q4: Write C++ program to apply the following instructions: > cin.getline ( str, 10 ); > cin.get ( ch…
A: In C++, cin.getline() function is a standard library function used to read a string or a line from…
Q: int a = 12; int b = 22; System.out.println(!(a >= b) || !(b>=a));
A: Given Question: If the expression's result is TRUE, write TRUE, and if the expression's output is…
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: ? What is the output if x-3, y=5 Step1: Start Step2: Read two values x, y Step3: Declare third…
A: Step1: Start Step2: Read two values x, y Step3: Declare third variable z Step 4: z = x…
Q: The following code segment is supposed to read all of the integers entered by the user until a blank…
A: The given code segment: values = [] inputstr = input("Enter a value (blank line to quit): ") while…
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: Write a statement to add the key Tesla with value USA to car_makers. Modify the car maker of Fiat to…
A: Required:
Write a single statement to print: user_word,user_number. Note that there is no space between the comma and user_number.
Sample output with inputs: 'Amy' 5
Amy,5
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
typing the response listed here gives an error.
Exited with return code 1. Traceback (most recent call last): File "main.py", line 6, in <module> print (user_word + ',', + (user_number)) TypeError: bad operand type for unary +: 'str'
- 0199% 10:00 docs.google.com/forms 13 last constant Problem 1 At a certain university, students have to submit their exams online. The administration decides that for each minute of late submission, 5 points are deducted. Write a program that asks the user for his initial grade and how long he delayed in submitting, and then displays the final result. Sample Run 1: Enter your initial grade: 82 Enter the late submission time (in minutes) : 6 Your final grade is 52 Sample Run 2: Enter your initial grade: 115 Grades should be between 0 and 100 Sample Run 3: Enter your initial grade: 43 Enter the late submission time (in minutes): 10 Your final grade is 0 Sample Run 4: Enter your initial grade: 72 Enter the late submission time (in minutes) : -2 Time should be positive Your answer Problem 2 Write a Java program integers day. month, and vear. You are NOT required to check if the values entered by the user are in give the user the ability to determine the day of a given date. The user shall…2. Write a program to input a number x from the keyboard. If the number is larger than 0, find its square root. Otherwise, calculate x* x. Write the program by using selection statement. A sample of the output showed as below. Please enter a positive or negative number: -4 You have entered -4 which is smaller than 0 Therefore -4 x -4 = -8 Hint: Use include to include sqrt function. Example: root=sqrt(x);Sample Input: Enter the year for which you wish to generate the calendar: 2004 Enter the day of the week that January first is on: 4 Sample output: Calendar for year 2004 January Sun 4 11 18 25 Mon 5 12 19 26 February Sun 1 Mon 2 Tue Thu 1 6 8 13 14 15 20 21 22 27 28 29 Tue 3 Wed 7 Wed 4 : Fri : 2 9 16 23 30 3 Sat 10 17 24 31 Thu Fri 5 6 7 Sat I
- 2. CommodityCodeProblemUsingSwitch_FamilyName A certain store has the following scheme: Commodity Code: 1 - commodities are discounted by 15% 2 - commodities are taxed by 12% 3 - commodities are charged as priced Using switch, create a program that reads a commodity code, quantity of the commodities bought and the unit price and output the amount to be paid by the customer. Depicted below are sample outputs when the program is executed (the items in bold characters are inputted by the user, while the items in bold italic characters are calculated and outputted by the program): Enter commodity code: 1 Enter quantity of commodity: 2 Enter unit price: 53.25 Amount to be paid is P90.53 Enter commodity code: 6 Invalid Code Enter commodity code: 2 Enter quantity of commodity: 2 Enter unit price: 53.25 Amount to be paid is P119.28 Enter commodity code: 3 Enter quantity of commodity: 4 Enter unit price: 53.25 Amount to be paid is P213PRG10: Write a program that accepts dates written in numerical form and outputs in complete form. :5 26 1986 : May 26, 1986 Enter date in number form Your date in complete form is PRG11: Write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the useR is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwh PRG12: Write a program that will simulate the Paper, Rock, Scissors game. Two players should be able to either P, R or S then the program shall determine who the winner is and state why he wins based on the following criteria: Sample Output Paper…(Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point numbers with random numbers that have been scaled to the range 1 to 100. Then determine and display the number of random numbers having values between 1 and 50 and the number having values greater than 50. What do you expect the output counts to be?
- (Misc. application) a. Write a program to reverse the digits of a positive integer number. For example, if the number 8735 is entered, the number displayed should be 5378. (Hint: Use a do statement and continuously strip off and display the number’s units digit. If the variable numinitially contains the number entered, the units digit is obtained as (num % 10). After a units digit is displayed, dividing the number by 10 sets up the number for the next iteration. Therefore, (873510)is5and(8735/10)is873. The do statement should continue as long as the remaining number is not 0.) b. Run the program written in Exercise 3a and verify the program by using appropriate test data.(Misc. application) a. Write a program that continuously requests a grade to be entered. If the grade is less than 0 or greater than 100, your program should print an appropriate message informing the user that an invalid grade has been entered; else, the grade should be added to a total. When a grade of 999 is entered, the program should exit the repetition loop and compute and display the average of the valid grades entered. b. Run the program written in Exercise 2a and verify the program by using appropriate test data.9 2357 00 0 Input 2 Write a program that repeatedly gets integer input from the user until the value 99999 is entered. The program must then print the values the user entered alternating between odd and even values starting with the first odd value as in the examples below. The odd and even values must respectively be in the order they were entered but the overall output will not necessarily be in the order entered. 8 If more odd or even values were entered, the program should continue to print the remaining values after all other odd/even values have been printed in the order they were entered. Note: You must use Queues to solve this problem: an implementation of the Queue class is given - you do not need to provide your own. You will have the following methods available from the Queue class: Queue(), enqueue(), .dequeue(), .peek(), len(), and.is_empty(). Note: You must NOT access private data fields of the Queue class, you must NOT create any other built-in collections (e.g. lists,…
- PLEASE COMMENT ALL CODE Create a python program that checks whether a number is even or odd. Sample run: Even or Odd Checker Enter an integer: 33 This is an odd number. Specifications Store the code that gets user input and displays output in the main function. Store the code that checks whether the number is even or odd in a separate function. validate the use inputs, only integers accepted, give the user an option to enter again, ask the user if wants to try again.235728 Write a program that repeatedly gets integer input from the user until the value 99999 is entered. The program must then print the values the user entered alternating between odd and even values starting with the first odd value as in the examples below. The odd and even values must respectively be in the order they were entered but the overall output will not necessarily be in the order entered. 9 If more odd or even values were entered, the program should continue to print the remaining values after all other odd/even values have been printed in the order they were entered. Input Note: You must use Queues to solve this problem: an implementation of the Queue class is given - you do not need to provide your own. You will have the following methods available from the Queue class: Queue(), enqueue(), dequeue(), .peek(), len(), and.is_empty(). Note: You must NOT access private data fields of the Queue class, you must NOT create any other built-in collections (e.g. lists, tuples,…7128 LAB: Variables/Assignments: Using math functions Given three flgating-point numbers xy and z outputx to the power of y x to the power off (v to the power of z the absolute value of x, and the squareroot of *y to the power of z) Output all results with five digits atter the decimal point, which can be achieved as followS Put result to output with 5 decinal places Ex If the input is 5.0 2.5 1.5 the output is 55.90170 579.32402 5.00000 6.64787 Hint Coral has built-in math functions (disoussed elsewnere) that may be used 128 1 LAB Variables/Assignments Using math functions LAB 0/10 ACTIVITY Load default template...