while a!='xyz': a = input()
Q: Describe a programming problem that would require the use of an accumulator.
A: Please find the answer below :
Q: Addition [351] with [135; 5 7 1]=[48 6:57 1] True O False O Multiplication [1 2 3;4 5 6] and [7 8 9…
A: Here is the solution:
Q: 1. Generate five strings for the regular expression (11+00)*101(1+010)* a. Example of a string of…
A: Given regular expression: (11+00)*101(1+010)* According to regular expression, it contains all the…
Q: Input (x1,x2,x3) 1 (0, 1, 1) 1 (1,0, 1) 1 (1, 1, 0) All other
A:
Q: Complete and modify the code:
A: Q: Complete and modify the code:
Q: limit-int (input ("Enter upper limit:")) C=0 m=2 while(c<limit): for n in range(1,mi1): a-m*m-n*n…
A: The answer is in below steps:
Q: Regular expression for all strings starts with ab and ends with bba is. a) aba*b*bba b) ab(ab)*bba…
A: * represents 0 or more times + represents either this or that symbol Let's explore the options and…
Q: Write a program in Python program to remove punctuations by taking input from the user as…
A: Using loop: Using List Comprehension:
Q: eclare an input named count that can represent a numeric quantity as big as 205. Use AHDL or VHDL.…
A: Answer: count IN INTEGER RANGE 0 TO 205;
Q: This built-in function can be used to read input that has been typed on the keyboard.a. input()b.…
A: This built-in function can be used to read input that has been typed on the keyboard is input()
Q: ode that will ask again what is asked if the input is wrong which has spaces
A: Whenever we use cin>>variable_name it takes an input till next space from user and saves it in…
Q: 4- Generates a random decimal number between 1 and 10 with two decimal places of accuracy (Examples…
A: Lets see the solution.
Q: The postfix form of the expression (A+ B)*(C*D- E)*F / G is? a) AB+ CD*E – FG /** b) AB + CD* E – F…
A: The given question are multiple choice selected question.
Q: Write a program in C++ language to take input two integers and print the GCD of the two integers in…
A: Given: Write a program in C++ language to take input two integers and print the GCD of the two…
Q: Write a R program that takes an input from the user and prints if the number is:
A: We need to input a number and check if it's divisible by 5 and 6 and output appropriate message to…
Q: Input an integer n. Display the square of 1 to n Input: An integer Output: The squares of 1 to n…
A: Task :- Write a C program to display the square from 1 to n. C program :- #include…
Q: Sample output with input: -9 -9 is negative 1 user_val = int(input()) 2 3 cond_str *' Your solution…
A: Please find the answer below
Q: Write a program that will ask for an integer number. Evaluate the input if it is positive or integer…
A: #include<iostream>using namespace std;int main (){ int j; cout << "Enter a number…
Q: true or false 1. Determine if the expression: ! (!(a>b) || ( a==c) || ( a>=b ) ) is True or False.…
A: 1) We have expression ! (!(a>b) || ( a==c) || ( a>=b ) ) 2) Values for a is 2, b is 10 and…
Q: Write a pseudocode that asks for a numeric grade and translates it according to the table below.
A: The complete pseudo-code for the given problem is shown below. Have a look.…
Q: Write a Pseudocode to find GCD for numbers which are less than 0 and greater than 0.
A: Pseudocode is an artificial and informal language that helps programmers develop algorithms.…
Q: 1. (Decimal to hex) Write a program that prompts the user to enter an integer between 0 and 15 and…
A: import java.util.Scanner;class Main{ public static void main(String args[]) { Scanner input…
Q: Define 16-bit variables x, y, and z. Write a program that computes z = z − (x + y). Explain how you…
A: 16-bit : 16-bit is a computer hardware device or software program capable of transferring 16 bits of…
Q: What output does the following pseudocode produce? Pseudocode: 1. input x 2. input y 3. s = X y 4. z…
A: Answer : C . outputs the square of first input number output :
Q: Create C program that loops from 1 to 30 and prints out each value on a separate line, except print…
A: According to the asked question, the solution is given below with a proper explanation.
Q: The prefix form of an infix expression (p + q) – (r * t) is? a) + pq – *rt b) – +pqr * t c) – +pq *…
A: – +pq*rt is the prefix expression of given infix expression (p + q) – (r * t).
Q: utput with input: 10
A: Code: userinput = int(input())if(userinput>=9 and userinput<=12): print("in high…
Q: 8. Write a C++ code snippet to input a whole number from the user and output double the number to…
A: PROGRAM: //Header file #include <iostream> //Using namespace using namespace std;…
Q: tters is more than lowercase letters. Otherwise, if lowercase is greate - uppercase letters, print…
A: GIVEN: For a given string, If the uppercase letters are greater than lowercase letters, convert the…
Q: Write a C++ code which takes a input from the user a time in the seconds then convert that time in…
A: 1- In this assignment, take the second input from the user, based on the input calculate the hour,…
Q: input: tick: pure output: go, stop: pure green tick / go tick /stop red tick / stop yellow
A: Please give positive ratings for my efforts. Thanks. ANSWER The FSM description for the…
Q: True Print > START Input a.b.c Is a equal to 0 True Print > STOP False Calculate D D<0? True…
A: The question mentions giving a flowchart for the roots of a quadratic equation. But it seems the…
Q: int x; Switch{x}; case 0; printf("zero"); case 1; printf("one); Defalt; invalid input;
A: Hi, there I wrote the full code hope you found it useful. please run my code in IDE. Thank you!
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 nth natural numbers(which will be user input) Determine the sum of the natural numbers…
A: I have given an answer in step 2.
Q: 'n=3 ,m-3 Lasie galill L: n=input ('enter n:'); m-input('enter m:'); for i=1:n for j-1:m…
A: Initially, m=3 and n=3 result is a 2-D vector storing values which gets finally printed
Q: Bit positions. Python or Java please! Preffers Python. Thank you Input: Your program should…
A: Given :- Bit positions. Python or Java please! Preffers Python. Thank you Input: Your program…
Q: 1) n-input ('enter an integer : ): if n>0 disp('the number is positive') elseif n<0 disp('the number…
A: The answer is...
Q: Take a four-digit number. Add the first two digits to the last two digits. Now, square the sum.…
A:
Q: Write a pseudocode that calculates the least common multiple between a number (a) and a number (b).
A: To Do: To calculate the LCM of two numbers a and b.
Q: int a 5,b- 3,c; printf("input a "); scanf("%d", &a); printf("input b : ") iscanf("&d", &b); e-a/b;…
A: Answer : 3 As the user input value replace the default values.
Q: The output will be as shown in Snippet 3.65: 10 15 20 25 30 35 80 85 90 Snippet 3.65
A: Note: The programming language is not mentioned in the question so the python programming language…
Q: number is divisible by 5 and 11 or not. * 1-..... 2-..... 3-.... 4-..... 1-lf ((n Mod 5 = 0) And (n…
A: We are going to write a logic for a program which will find if a number is divisible by 5 and 11 or…
Q: Write an expression using Boolean operators that prints "Eligible" if user_age is greater than 17…
A: Boolean Operars: Boolean operators only work with the boolean values 0and or true or false. Boolean…
Q: If (((R10<=1) && (R9<=9) || ((R10==2) && (R9<=3))) goto looph; else R9 = 0; please…
A: Here i am converting c code to assembly :…
Q: Jlgull Sinesoldal plot cos 04- 02 02 0.6 -1 Ande Write a program to get the result as shown when the…
A: Answer: I have done code and also I have attached code as well as output
Q: all perfect numbers between num1 and num2. A positive integer is called a perfe all of its positive…
A: We need to read in two integers ,then we can use the user defined method isPerfectNumber() that…
Q: Input two numbers Start Input Add or Subtract or Product or Divide Input A or B A for Quadratic…
A: Please find the answer below :
Step by step
Solved in 2 steps
- Suppose a right triangle is placed in a plane asshown below. The right-angle point is placed at (0, 0), and the other two pointsare placed at (200, 0) and (0, 100). Write a program that prompts the user to entera point with x- and y-coordinates and determines whether the point is inside thetriangle. Here are the sample runs: Enter a point’s x- and y-coordinates: 100.5 25.5 ↵EnterThe point is in the triangle(Display Magic Numbers) Display the first N magic numbers, where N is a positive number that the user provides as input. Here, a magic number is a number whose sum of its digits eventually leads to 1. For example, 1234 is a magic number because 1 + 2 + 3 + 4 = 10 and 1 + 0 = 1, while 1235 is not (1 + 2 + 3 + 5 = 11 and 1 + 1 = 2). Write a program that prints out the first N magic numbers, seven on each line. Here is the sample output: You are required to use the following function prototype: bool isMagic(int value); // Returns true if value is a magic number The outline of this function will be as follows: Step 1: Calculate the sum of digits of value Step 2: Repeat Step 1 until we get a single digit Step 3: If the resulting sum is equal to 1 then it is a magic number, otherwise notWrite a program that prints the numbers from 1 to 100, except if the number is divisible by 3 print 'Beep' instead of the number and if it is divisible by 5 print 'Boop'. For numbers which are divisible by both 3 and 5 print 'BeepBoop'. (See the output below: 3 and 6 are replaced by 'Beep'; 5 and 10 are replaced by 'Boop'; 15 and 30 are replaced by 'BeepBoop') Use a for loop.
- Write a program that asks the user to enter a word that contains the letter a. The program should then print the following two lines: On the first line should be the part of the string up to and including the first a, and on the second line should be the rest of the string. Sample output is shown below:Enter a word: buffalo buffa loOutput integer's digits Given an input positive integer, output each digit on its own line, starting with the rightmost digit. Ex: If the input is 935, the output is: 5 3 9 Hints: Use the mod operator (%) to get the rightmost digit. Mod by 10 to get the rightmost digit. Use a loop that keeps a current dividend (the number being divided). In each iteration, output the rightmost digit, then update the divisor by dividing by 10. End the loop when the divisor is 0. in javaWrite a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score (display the student’s name and score). Also calculate the average score and indicate by how much the highest score differs from the average. Use a for loop. Test Data: Ben Simmons 70 Carson Wentz 80 Joel Embiid 90 Bryce Harper 75 Redo Problem A. Replace the for loop with a while loop
- Using a loop, extend the program to handle multiple lines of input. Continue until the user enters q to quit. Ex: Enter input string: Jill, Allen First word: Jill Second word: Allen Enter input string: Golden , Monkey First word: Golden Second word: Monkey Enter input string: Washington,DC First word: Washington Second word: DC Enter input string: q pythonWrite a program that prompts the user to enter a series of strings, but with each string containing a small integer. Use a while loop and stop the loop when the user enters a zero. When the loop has finished, the program should display: the number of user inputs (not counting the final zero input). the total of the integers in the strings entered. the average of the integers accurate to one decimal place.A loop should sum all inputs, stopping when the input is 0. If the input is 2 4 6 0, sum should end with 12. What should XXX, YYY, and ZZZ be? Choices are in the form XXX / YYY / ZZZ. intsum;int currVal;XXX;currVal = scnr.nextInt();while (YYY) {ZZZ;currVal = scnr.nextInt();}a. sum=0/currVal!=0/sum=sum+currVal b. sum=currVal/currVal==0/sum=currVal c. sum=1/currVal!=0/sum=sum+1 d. sum=scnr.nextInt()/currVal==0/sum=scnr.nextInt() JAVA
- Write a program that asks the user to enter a word that contains the letter a. The program should then print the following two lines: On the first line should be the part of the string up to and including the first a, and on the second line should be the rest of the string. Sample output is shown below:Enter a word: buffalobuffalo2. Write a program that takes as input two opposite corners of a rectangle: the lower left-hand corner (x1,y1) and the upper right-hand corner (x2,y2). Finally, the user is prompted for the coordinates of a third point (x,y). The program should print Boolean value True orFalse based on whether the point (x,y) lies within the rectangle.>>> ========================= RESTART=========================>>>Enter x1: 1Enter y1: 3Enter x2: 10Enter y2: 6Enter x: 4Enter y: 4True>>> ========================= RESTART=========================>>>Enter x1: 1Enter y1: 3Enter x2: 10Enter y2: 6Enter x: 4Enter y: 2FalseWrite a code that will loop by inputting any integer and displays whether the integer is “POSITIVE” or “NEGATIVE”, and terminate the loop if the integer is equal to zero using while loops.