This is a segment of program, when it executed with multiple values for n and s the program displays the value of f, choose which output of f values are wrong answers cin>>x>>y; if (x>1) &&(y<5) {f=x+y*9; else f-x-y-11; } cout<
Q: Write a program that reads in an integer, N, and computes the first N Pell numbers and outputs them…
A: Below is the required program in C language. Approach of Program: Include necessary header files.…
Q: Write a program that asks the user to enter a list of lengths and radius of a special screw. The…
A: Note: As you have not mentioned any programming language, the code is written in Python language.…
Q: [6] Your Problem: Write a program that finds the following for: y =x^2 + 2*x - 5 m(tan) = f'(x) at…
A: NOTE: Since programming is not mentioned. Therefore answering questions in Python language. In this…
Q: Write a python program: Let the user specify S (the number of sides on a die) and N (the number…
A: Import the random library and prompt the user for the values of N and S. Use a for loop for N times…
Q: Given the following program segment: int first = 3; int second = 4; int j; for ( j = 1; j <=…
A: int first = 3; int second = 4; int j = 1; while ( j <= first) { cout << second * j…
Q: Q2: Write a FORTRAN90 program that reads a student ID and his GPA out of 4.0. The program should…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Decryption Key A|B|C| D|E|F|G|H|I|J|K|L|M N|O|P|Q|R|S|T|U|V|W|X|Y|Z (letter above equals below, and…
A: Hence, there is no programming language is mentioned I have solved your question using c++…
Q: What is the value stored at variable "x" after executing the following code segment double vol[3]…
A: The above program finds sum of all elements in the 2D matrix except a[2][j] elemnts So, the sum of…
Q: a. Line 1 for (int i=n-1; i<=n; i++) { f(n) = O( Line 2 for (int j=1; j<=n; j=j*2) { Critical…
A: Given: Given Java question, we need to fill in the blanks.
Q: A factorial of N is defined as 1 if N is O or 1, and 1*2**N if N is a non-negative integer. Write a…
A: note:- only one program will be solved if they are not linked . Also mention programming language…
Q: Use C language in this program
A: Here I have created a function named gcd(). Inside the function, I have created the condition to…
Q: Write a program that prompts the user for a positive integer, the first term in a hailstone…
A: C++ used to answer this question
Q: A group of monkeys have N bananas in day 1. In the next each day, these monkeys eat half the number…
A: For this, first lets take an examplewith d= day which is givenn = no of banana left on day d Let d =…
Q: Write a program that reads an unspecified number of integers and finds the ones that have the most…
A: GIVEN: Write a program that reads an unspecified number of integers and finds the ones that have the…
Q: Write a program that uses random function to randomly generate 6 integers between 0 and 99 with 0…
A: Required: Write a program that uses random function to randomly generate 6 integers between 0 and 99…
Q: Write a program that computes the equivalent resistance of a purely series and purely parallel…
A: Given: Write a program that computes the equivalent resistance of a purely series and purely…
Q: If X iş an integer variable that I have yalue of o K9 is an integer variable of value 1, then when…
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: Write a program that will check whether an input whole number is a multiple of 5 or 7. Display the…
A: => The answer start from step-2.
Q: Decryption Key A|B|C|D|E|F|G|H|I|J|K|L|M N|O|P|Q|R|S|T|U| V| W|X|Y|Z (letter above equals below, and…
A: Here is the c++ program of above problem. See below step for code.
Q: Q1:A, B, C are three positive numbers (A<=B<=C). Given a list of seven numbers which are made of A,…
A: Answer
Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's…
A: Program Algorithm-STARTStep 1: Import the essential headers.Step 2: Define the main function.Step 3:…
Q: A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: I give the code in Python along with output and code screenshot and explanation
Q: The following code examines two variables -- x and y -- and prints the largest odd number among…
A: We are given a function largestOdd that finds the largest odd number among two numbers x and y…
Q: Write a program that repeatedly reads in integers until a negative integer is read. The program also…
A: Given: Write a program that repeatedly reads in integers until a negative integer is read. The…
Q: In Coral Programing!! Write a program that takes in an integer in the range 20-98 as input. The…
A: Read an integer as input. Check if the integer is between “20” and “98”. If yes, move on to next…
Q: Write a program that will check whether an input whole number is a multiple of 5 or 7. Display the…
A: here in the question ask for a program that will check whether an input is multiple of 5 or…
Q: Write a program that reads three integer numbers and displays their square ar cube value using…
A: C++ code: #include <iostream> using namespace std; int main(){ //take array of 3 integers…
Q: Write a program that reads the integers between1 and 50 and counts the occurrences of each. Assume…
A: Program code: //import the required packages import java.util.Scanner; //Define a class Int_occur…
Q: Write a program that takes an integer num between 1 and 99999, then computes the number of digits in…
A: The integer entered by the user is stored in variable n. Then the while loop is iterated until the…
Q: SeaMoney has a feature to transfer money between users. Let's imagine a simple scenario. N…
A: Using hashmap to store the username as key and balance as associated value with the key. Below is…
Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's…
A: The below-given python program will obey the following rubrics: In the program we are defining two…
Q: Write a program that reads an integer value from the user rep- resenting a year. The purpose of the…
A: As all the parts you have given are different and not related to each other. so I did the 1 part as…
Q: 3.27 LAB: Mах of 3 Write a program that takes in three integers and outputs the largest value. Ex:…
A: Given: To write code in C.
Q: Write a program that computes the fuel efficiency of a multi-leg journey. The program will first…
A: Python code :- def question9(): print("Question 9) # arrays to store miles and gas used…
Q: Write a program that does temperature converter", "- The user will enter if he wants the result in…
A: The following are steps needs to be taken for the given program: Asking user the temperature as…
Q: have to enter before there is a match? Write a program called birthday.py that accepts trials (int)…
A: Coded using Python 3.
Q: Write a program that prompts the user to enter an integer (n) and a sum value (s). The program…
A: PROGRAM CODE: import java.util.*; // import java utility packagepublic class…
Q: python code
A: Prompt the user to input a starting balance and an interest rate. Compute the balance after 10…
Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and O's…
A: I have implemented the given requirements in python as per the specification. The code in python is…
Q: Write a program that calculates the value of (pi) from the following series. Stop calculation when…
A: Logic: Initially assign pi with 0 and i with 1. Iterate a loop until value of pi exceeds 8.7235.…
Q: In Python, A sales event at Trader Jane's is reducing some items by 25%. Store that value to a…
A: Program Planning Prompt the user for giving input on the ticket price of the item. Store the input…
Q: Q4: Write a FORTRAN90 program that reads a student ID and his GPA out of 4.0. The program should…
A: Algorithm: Start Read student ID and GPA If gpa>=3.5 then print "EXCELLENT" Else if gpa<3.5…
Q: The first 11 prime integers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31. A positive integer…
A: This Program has been solved using the C language.
Q: Write a program that calculates the points earned by a soccer team. The program reads from the user…
A: Code explained in comments:
Q: In Coral Programing!! Write a program whose input is two integers, and whose output is the first…
A: PROGRAM EXPLANATION: - Three integer variables are declared. The variable incrementBy is…
Q: A certain CS professor gives 5-point quizzes that are graded on the scale5-A, 4-B, 3-C, 2-D, 1-F,…
A: Lets see the solution.
Q: A piece of programm code is given: int A[1200]; ... int find_in_arr(int * A, int x) { int found =…
A: search(arr, n, x) if arr[n-1] == x // 1 comparison return "true" backup = arr[n-1]…
Q: Write a program that will check whether an input whole number is a multiple of 5 or 7. Display the…
A: Step-1: Start Step-2: Start a try block Step-2.1: Declare variable num and take input Step-2.2: if…
Q: A variable like userNum can store a value like an integer. Extend the given program as indicated. 1.…
A: Given requirement, A variable like userNum can store a value like an integer. Extend the given…
Q: rite a program that reads a value n and displays n characters alternating between # and % on the…
A: Note: Since you have not provided the language name to write the code so I am using java language to…
Step by step
Solved in 2 steps
- In Coral Programing!! Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is 93, the output is: 93 92 91 90 89 88 Ex: If the input is 77, the output is: 77 Ex: If the input is not between 20 and 98 (inclusive), the output is: Input must be 20-98 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.5.A)For the code segment below, what should be the values for q will result in kiwi being included in the output? switch(q) { case 1: cout << "apple"; break; case 2: cout << "orange"; break; case 3: cout << "banana"; break; case 4: cout << "pear"; case 5: cout << "grapes"; default: cout << "kiwi"; } B)Evaluate the following segment of a program. Show the procedure to reach your answer. int a = 3, b = 5, c = 2, d = 4; find: !(a / b > 0) && (22 > b % c + d) || !(a * d >= b – d / c) C) Write equivalent expressions for each of the following by using De Morgan’s Law. !(c == ‘r’ || (( y > 2) && !found ))Please code in C++. Write a program that simulates a coin-tossing game. At the beginning of the game, each of N players has a single fair coin and M points. The game performs a sequence of passes until only a minimum number of players remain. In a pass the players toss their coins into the air and when the coins fall to earth, the players count the number of coins that show heads and the number of coins that show tails. If the number of heads exceed the number of tails, then the players who tossed heads increase their points by an integer P and the players who tossed tails decrease their points by the same integer P. The players perform the opposite actions when the number of tails is greater than the number of heads. If the number of heads equals the number of tails, then no player’s points change. If any player’s points fall below one, then the player leaves the game, never to return. The game employs a second integer K to compute P’s value. K’s and P’s initial values are one.…
- C++ Create a program that reads a simple arithmetic expression and evaluates it. More precisely, the program reads from the user a line of text that’s supposed to contain two numbers separated by an arithmeticoperator, as in: 35.6 + 12 The program then prints back the expression and its value, as in: 35.6 + 12 = 47.6 The program should verify that the input line contains two numbers, one operator and nothing else. There can be whitespace before the first number, after the second number and between each number and the operator.The operator can be either +, −, *, or /. In case of an error, the program should print: "Invalid expression" and quit.When the program prints the expression, there should be no whitespacebefore the first number and there should be exactly one blank space beforeand after the operator and the equal sign.Use string streams.USING SCHELL SCRIPT FOR GITBASH WRITE A PROGRAM USING FOR LOOP OR FUNCTIONS Find the even multiples of any number chosen by the user in a given range – the usershould specify the multiples of which number they want to print and a minimum and maximumvalue. The multiples printed should be within the [minimum, maximum] range. For example, ifthe user choses the number 7 and would like to print all even multiples in the [15, 60] range, theprogram should print all the even multiples that are bigger than or equal to 15 (minimum), butsmaller than or equal to 60 (maximum). The program should keep a count of how many numberswere printed and should output that count, as well as the numbers. The output then, for theexample given, should be 28, 42, 56, and the count should be 3. THE IMAGE IS HOW THE OUTPUT SHOULD LOOK LIKEin javascript please create a function that does the following and is named as such please don't copy and paste the incorrect answer sequence( start, step ) This function takes two numeric inputs, start and step, and returns a function of no inputs. The ith invocation of the resulting function will generate the value: start + step * i. The first invocation is said to be the 0th. Examples var x = sequence( 3, 15 ) [ x(), x(), x() ] => [ 3, 18, 33 ] var y = sequence( 28, -5 ) [ y(), y(), y() ] => [ 28, 23, 18 ]
- CHALLENGE ACTIVITY 6.7.3: Function with loop: Shampoo. Write a function print_shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N : Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.". Sample output with input: 2 1 : Lather and rinse. 2 : Lather and rinse. Done. Hint: Define and use a loop variable. Use Python, please.THIS IS C++ Martin wants to create a program that requires the user to input 10 integers then print the total numberof even integers, highest even integer, lowest even integer, total number of odd integers, highest oddinteger, and lowest odd integer. If, however, the user inputs zero (0), the program will display “You havenot yet entered 10 integers.”Below is the sample output of the program Martin created.Enter the integers:Integer 1: 15Integer 2: 9Integer 3: 71Integer 4: 35Integer 5: 17Integer 6: 13Integer 7: 63Integer 8: 33Integer 9: 97Integer 10: 13Total number of even integers : 0Highest even integer : noneLowest even integer : noneTotal number of odd integers : 10Highest odd integer : 97Lowest odd intege QUESTION: 1. What conditional operation is requires producing counting the even numbers? 2. What conditional operation is requires producing counting the odd numbers? 3. What are the variables needed to produce the desired output? 4. What did you observe in arranging the…This is C++ Martin wants to create a program that requires the user to input 10 integers then print the total numberof even integers, highest even integer, lowest even integer, total number of odd integers, highest oddinteger, and lowest odd integer. If, however, the user inputs zero (0), the program will display “You havenot yet entered 10 integers.”Below is the sample output of the program Martin created.Enter the integers:Integer 1: 15Integer 2: 9Integer 3: 71Integer 4: 35Integer 5: 17Integer 6: 13Integer 7: 63Integer 8: 33Integer 9: 97Integer 10: 13Total number of even integers : 0Highest even integer : noneLowest even integer : noneTotal number of odd integers : 10Highest odd integer : 97Lowest odd integer QUESTION: Write the corresponding algorithma. Narrative C. Algorithm b. Pseudocode2. Create the equivalent flowchart based on the algorithm of the given problem.3. Construct the program and record your screen display result
- The program below stores 80 bool values into a char arr[10]. CompletesetBool and getBool. In both functions, index is the index of the boolvalues, from 0 to 79. getBool returns 1 if the bool value at index is trueotherwise 0. You will probably need most bitwise operations including shifting. void setBool ( char * arr , int index , int boolValue ) {}int getBool ( char * arr , int index ) {}int main ( void ) {char arr [10];memset ( arr , 0 , 10);setBool ( arr , 78 , 1);setBool ( arr , 40 , 0);int b78 = getBool ( arr , 78); // b78 is 1int b40 = getBool ( arr , 40); // b40 is 0return 0;}int const MULTIPLIER = 5; is a valid way to declare a constant integer variable. Group of answer choices True False ------- Given the following code segment, what is output to the screen? int num1 = 6; int num2 = 4 * num1++; cout << "num1=" << num1 << " num2=" << num2; Group of answer choices num1=7 num2=24 num1=6 num2=24 num1=6 num2=28 Nothing, because the code does not compile.This is a segment of program, when it executed with multiple values for n and s the program displays the value of f, choose which output of f values are wrong answers