What is the output of the following pseudocode Set age=40 Set year = 2020 - age Display "Year = " , "year" 1980 = year Year = year Year = 1980 Year = 2020
Q: Write a pseudocode algorithm to prompt the user to enter the current year and the year a person was…
A: 1) Below is Pseudocode program to input current year and born year of a person, calculate the age of…
Q: a Krishnamurthy Number because, 1! + 4! + 5! = 1 + 24 + 120 = 145 "40585" is also a Krishnamurthy…
A: The code provides two helper functions and implements the krishnamurthy_number function to check if…
Q: Golf scores record the number of strokes used to get the ball in the hole. The expected number of…
A: Step 1 : STARTStep 2 : declare all variablesStep 3 : input par and strokeStep 4 : using if else if…
Q: Marketing person contains the values { total product sales, commission rates, person base salary}.…
A: The Answer is
Q: The array name will always point to the first element of the array. Select one: O True False
A: Array is a Collection of element of same data type. Array name Represent thee address of the first…
Q: Look at the following statements:int[ ] numbers1 = { 1, 3, 6, 9 };int[ ] numbers2 = { 2, 4, 6, 8…
A: Indexing of an array starts with 0. Therefore to access the element 0, we can access the element as…
Q: R studio : profit margin for each month - equals to profit a after tax divided by revenue…
A: Below is the complete solution with explanation in detail for the given question about profit margin…
Q: Filename: Lab_exer19 Write a program that will read an integer value and will display the…
A: PROGRAM CODE: #include <stdio.h>int main() { int n, i; printf("Enter a number : ");…
Q: Cyclops numbers def is_cyclops(n): A nonnegative integer is said to be a cyclops number if it…
A: Given: Cyclops numbersdef is_cyclops(n):A nonnegative integer is said to be a cyclops number if it…
Q: Module main() // Local variables Constant Integer SIZE = 7 Declare Integer index, numbers[SIZE]…
A: Flowcharts were first used to record business operations in the 1920s and 1930s. The Flow Process…
Q: Enter Quizzes: 50 Enter Final Exam: 50 Enter Evaluation: 50 Sample Output Number Recitation Quizzes…
A:
Q: Input 90 -7 10 eight -2 0 end
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: The book Id number is represented in the following pattern: 0-07-041183-2. The first part(0)…
A: Python code given below
Q: Using C++ Language Modify the provided code as follows. • Declare another array of the same size…
A: #include <iostream>using namespace std; int main(){ const int SIZE=5; int sumHeight=0;…
Q: Write a program to find sum and average of two numbers input by User (using Scanner class).
A: Write a JAVA program to input two numbers using the Scanner class and find the sum and average of…
Q: ?lf a column is defined as NUMBER(5,2), which of the following is true The column can store a total…
A: Given:
Q: The intItems array is declared using the Dim intItems(20) As Integer statement. The intSub variable…
A: Array: An array is a data structure that is used to store more than one value of the same data type…
Q: Create pseudocode of the following numbers. 1. N factorial [e.q. Where N! = 1*2*3*..*(N-1) *N] 2.…
A: Pseudocode for Factorial of a number : Step 1: Declare A and B as integer variable. Step 2:…
Q: Golf scores record the number of strokes used to get the ball in the hole. The expected number of…
A: The objective of the question is to write a program that takes two integers as input, representing…
Q: Please help me with this using java. Create a selection sort java code Please also comment the code
A: The answer of this question is as follows:
Q: Girl Scout Troop 815 has 18 members. Write the pseudocode for a program in which the troop can enter…
A: The following the required pseudo code for display the total number of boxes sold and calculate…
Q: Should Be in Java: use loops, if statements, arrays, scanner etc Write an application that stores…
A: In the program provided below, 2-d array, if statements, Scanner, etc have been used as asked in the…
Q: Golf scores record the number of strokes used to get the ball in the hole. The expected number of…
A: Prompt the user to enter the strokes and then par score. Store the received values in score and par.…
Q: Write the code and show the result for each step.
A: setx=1011,0011b // setx = 10110011 in binaryAL=setx // AL = setxAND : AL,1001,0011b // AL =…
Q: A(n) comment hides multiple lines of code. O yariable O element O line O block
A: To block comment/*/code: In the C/C++ editorial manager, select different line(s) of code to remark…
Q: Display a given a decimal value in every base from 2 (binary) through 16 (hexadecimal). Input…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: Complete this code using python language #Write the conditions to check if anyone has won the game.…
A: It is defined as an interpreted, object-oriented, high-level programming language with dynamic…
Q: What will be result of the given code: echo mt_rand(6,10); a. any random number between 1 and 4 b.…
A: mt_rand() is used to generate random numbers
Q: String is an array of characters with null character as the last element of array Select one: O True…
A: The given question is true.String is an array of characters with null character as the last element…
Q: Review Figure 6.0. In the REST web service, data can be restored in various formats. Figure 6.0 Code…
A: Data that is transmitted by web services needs to be formatted in a way that is easy for both humans…
Q: ING Chess Moves Mapper using Shortest path algorithm As the title indicates, you will need to…
A: It is defined as a interpreted, object-oriented, high-level programming language with dynamic…
Q: he following are some examples of Krishnamurthy numbers: 45" is a Krishnamurthy Number because, + 4!…
A: The find_factorial function calculates the factorial of a given number n. It initializes fact to 1…
Q: q1: The size of data variable of type Byte is byte Group of answer choices 1 2 3 4
A: We need to find what is the size of a data variable of type Byte. We have 4 options given, that are…
Q: Please written by computer source What will be displayed if the following pseudocode was coded and…
A: Introduction: The given pseudocode contains an if-else statement that will be executed based on a…
Q: Challenge Problem: What will be stored in number at the end of the code?
A: Here, number, number2 and number3 are variables and let's see how they changes after executing step…
Q: In this laboratory & assignment, you will draw a series of 6 star and numbers patterns using nested…
A: Given : All The Pattern Program Solution given in further Steps.
Q: Module main() // Local variables Constant Integer SIZE = 18 Declare Integer numbers[SIZE] =…
A: Here, we have the given code. We need to convert the code into a flowchart. The code will perform…
Q: In Signed & Magnitude Negative Integers Representation
A: In Signed & Magnitude Negative Integers Representation Two values for zero Easy Addition and…
Q: anded notation for 145. 145 = ( __ X 100)+
A: Expanded notation, often known as expanded form, is a convenient way to represent numbers that shows…
What is the output of the following pseudocode
Set age=40
Set year = 2020 - age
Display "Year = " , "year"
1980 = year
Year = year
Year = 1980
Year = 2020
Step by step
Solved in 2 steps
- PYTHON ONLYPlease create a code that checks if 'user' favourite game is in the top 3 games. if the game is in the top 3 then it should say: "common favourite game" if else then "uncommon favourite game"code: TOP_3_GAMES = {'', 'CALL OF DUTY', 'LEAGUE OF LEGENDS', 'VALORANT'}def division_calculator(a, b): ''' Question 4 You are asked to write a small division calculator, where you are taking 'a' as dividend and 'b' as the divider. You will need to return both the quotient and the remainder. Your returned result should be the: "a is divided by b, with the quotient equals 'quotient' and remainder equals 'remainder'" Note: You must use f-string to do this question. Args: a (int), b (int) Returns: string >>> division_calculator(3, 1) "3 is divided by 1, with the quotient equals 3 and remainder equals 0." ''' # print(division_calculator(9, 3))Cyclops numbersdef is_cyclops(n):A nonnegative integer is said to be a cyclops number if it consists of an odd number of digits so that the middle (more poetically, the “eye”) digit is a zero, and all other digits of that number are nonzero. This function should determine whether its parameter integer n is a cyclops number, and return either True or False accordingly n Expected result 0 True 101 True 98053 True 777888999 False 1056 False 675409820 False
- C++ Language Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places. INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater…Sum of two squares def sum_of_two_squares(n): Some positive integers can be expressed as a sum of two squares of some positive integers greater than zero. For example, 74 = 49 + 25 = 72 + 52. This function should find and return a tuple of two positive integers whose squares together add up to n, or return None if the parameter n cannot be broken into a sum of two squares. To facilitate the automated testing, the returned tuple must present the larger of its two numbers first. Furthermore, if some integer can be broken down to a sum of squares in several ways, return the breakdown that maximizes the larger number. For example, the number 85 allows two such representations 72 + 62 and 92 + 22 , of which this function must return (9, 2). The technique of two approaching indices that start from the beginning and end of a sequence, respectively, and approach each other until they meet somewhere, used in the function two_summers in one of our class examples, is directly applicable to this…Sum of two squares def sum_of_two_squares(n): Some positive integers can be expressed as a sum of two squares of some positive integers greater than zero. For example, 74 = 49 + 25 = 72 + 52. This function should find and return a tuple of two positive integers whose squares together add up to n, or return None if the parameter n cannot be broken into a sum of two squares.To facilitate the automated testing, the returned tuple must present the larger of its two numbers first. Furthermore, if some integer can be broken down to a sum of squares in several ways, return the breakdown that maximizes the larger number. For example, the number 85 allows two such representations 72 + 62 and 92 + 22 , of which this function must return (9, 2).The technique of two approaching indices that start from the beginning and end of a sequence, respectively, and approach each other until they meet somewhere, used in the function two_summers in one of our class examples, is directly applicable to this…
- user_tickets = int(input())if user_tickets< 5:num_tickets=1else:num_tickets= user_ticketsprint('Value of num_tickets:', num_tickets)PYTHON PROGRAMMING ONLY PLEASE CODE IS CORRECT BELOW COULD YOU PLEASE INCLUDE INPUT VALIDATION INTO THE CODE THATS THE ONLY THING TO BE DONE # Getting the number of days from the usernum_days = int(input("Enter the number of days: ")) # Initializing variablessalary = 0.01 # Initial salary on the first daytotal_pay = 0 # Initializing total pay to 0 # Printing a table headerprint("Day\tSalary")print("------------------") # Calculating and displaying the salary for each dayfor day in range(1, num_days + 1): total_pay += salary print(f"{day}\t${salary:.2f}") salary *= 2 # Doubling the salary for the next day print("------------------") # Displaying the total pay in dollarsprint(f"\nTotal pay over {num_days} days: ${total_pay:.2f}")You have the following workspace in MATLAB: Workspace Name Value Beccentricity Egrav_const Binclination Emass_Earth Horbit_period Bradius_Earth E semi_major E spacecraft_loc 6918900 E spacecraft_vel 7.5883e+03 2.8300e-04 6.6730e-11 28.4700 5.9720e+24 95.4320 6378000 6917100 In the box below, fill in the exact command necessary to delete the variable spacecraft_vel from the workspace without deleting any other variables clear spacecraft_vel Question 2 In MATLAB, you are calculating friction forces on five rail materials for a comparison study. One variable you must define is the time traveled on the aluminum rail. Which of the following are appropriate, descriptive variable names that could be used for this variable? Select all that apply. timeAl alum time Alt U aluminum time
- Which aggregating procedures are permitted for struct variables but not array variables, and which are not allowed for array variables?JAVA ONLYPlease create a code that checks if 'user' favourite game is in the top 3 games. if the game is in the top 3 then it should say: "common favourite game" if else then "uncommon favourite game"code: TOP_3_GAMES = {'', 'CALL OF DUTY', 'LEAGUE OF LEGENDS', 'VALORANT'}Payment = Principal [rate ((1 + rate)months)] [(rate + 1)months - 1] For the formula to compute monthly payment, see Listing 2.9, ComputeLoan.java. (Financial application: loan amortization schedule) The monthly payment for a given loan pays the principal and the interest. The monthly interest is computed by multiplying the monthly interest rate and the balance (the remaining princi- pal). The principal paid for the month is therefore the monthly payment minus the monthly interest. Write a program that lets the user enter the loan amount