150% + Reset NCT e-Learning Portal Question 21 Find the errors in the program and rewrite the correct statements Not yet r=int (input ("Enter r value=")) W==int (input ("Enter w value=")) if R==W: answered Marked out of 4.00 Print ("W:",w) P Flag question else: print ("R:"R)
Q: 1. Find the incorrect/missing parts and correct them. Program Answers #include int main(void); int…
A: The given code has some errors and some missing parts. I have modified the code accordingly.
Q: for (int i = = 0; i <= 8; i++) int squared = i * i; System.out.println (i + " + squared, 11 squared…
A: answer: variable scope error explanation: the variable which is declared inside a loop which can…
Q: given integer d) HWFactors) Write a program to input a number from user and find all factors of the…
A: As per the answering guidelines solving the first question. Also since programming language not…
Q: Select the best answer about the following code fragments (a) and (b): (a) if (age…
A: I run both the code in java, because from analaysing the code its written in java you can see i got…
Q: The average of a set of values can be calculated by the following equation. Write the proper code…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: 1- Write a program to find the average of 50 numbers and print the result. 2- Write a program to…
A: program for average of 50 number : #include <iostream> using namespace std; int main() {…
Q: Matlab code if you knew to include marks as in the Following: Write a program that ask about the…
A: prompt = "Enter the number of students. "; x = input(prompt) ag = 0; fg = 0; sum = 0; for a = 1 : x…
Q: z=0 i-5 x-int(input("Enter any number")) while i< x z=2+i/i+5 print(z) i=i+5 for the above program,…
A: The output of this code is a number. It calculates the expression z= z + i/i+5;
Q: Enter Quizzes: 50 Enter Final Exam: 50 Enter Evaluation: 50 Sample Output Number Recitation Quizzes…
A:
Q: Find the errors in the program and rewrite the correct statements P==int(input("Enter the P Value")…
A: Given: P == int(input("Enter the P value") Q=int(input"Enter the Q value")) if P<q: print("P=",p)…
Q: Fill in the blank(s) with the correct word. A(n) ............... is a specific procedure for…
A: Efficient problem solving is needed to achieve goal.
Q: Declare five variables a, b, c, d, e, and f. Assign a a number literal between 5 and 15 and assign b…
A: NOTE - I have report output here executed by C++ compiler. /* Initialization of given variables…
Q: 3.3 Suppose a ball is dropped from a height of 2 meters onto a hard surface and the coefficient of…
A: Logic: write a function names bounce() that takes an argument n and does the following 1.) set e =…
Q: Write a program whose input is a string which contains a character and a phrase, and whose output…
A: As no programming language is mentioned, it is solved using basic Python
Q: Exercise 5: Modify the Chaos program so that the number of values to print is determined by the…
A: Given The answer is given below.
Q: Q3/ write a Math-lab program by using for statements loop in same time with while statements loop.…
A: The FOR loop is nicer and more compact if the number of iterations is known before the loop is…
Q: 2) Calculate y = x³ – 3x + 12 for x = [0, 1, 2, –3,–6, 200, –9] , print rules given below and y…
A: C++ Code for the given expression for all values of x #include <iostream> using namespace std;…
Q: Question No:3 Part: A. Write an algorithm to input three different numbers, and then output the…
A: Algorithim is step wise explanation of a problem. An algorithm must be unambiguous ,has finite steps…
Q: 3. The following pseudocode describes a simple algorithm which swaps the values in two variables, x…
A: Required: Please make it clear can you give me how you did it? Trace this sequence using a separate…
Q: 5.17 LAB: Countdown until matching digits Write a program that takes in an integer in the range…
A: Given: To write a code.
Q: Estimate the result when you execute the following code by using Qbasic programming For m take the…
A: Let us see the output below,
Q: Complete the program shown in the 'Answer' box below by filling in the blank so that the program…
A: sill2([0, 0], [2, 3], -3).
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: Enter number of month M (1 January,..., 12 December): 6 Enter number of day D: 30 The zodiac sign is…
A: Here is the approach : Take input for the date and month Create the function to get the number of…
Q: Write a problem that counts the number of words in a sentence input by the user. Save it as…
A: Justification: You are getting this error because, indentation of the code (from 4th line) is not…
Q: Trace the following program showing the values of i, j, and z ?at each step void main() { int i=0,…
A: Outer while loop will go from i=0 till i=5 Inner loop will start from j = 0 to j=4,…
Q: stion 12 Write a program to compute your lucky number from your birthdate that integer values (day…
A: I have written the code below:
Q: IDENTIFY THE CALL STATEMENTS, ALGORITHM, AND LISTS IN THE CODE BELOW. #BMI Program def…
A: The call statements are printBMI(Imperialweight ,Imperialheight)…
Q: Change the program above to add the numbers 157 and 13. (Hint: these numbers are constants and…
A: Mail box Mnemonic code Numeric code Instruction 00 IN 901 ;input 1st number 01 STO 99 399…
Q: 6. Create a program that will convert: 6.1 Degree Fahrenheit to degree celsius and vice versa.
A: Since you have asked multiple questions we will answer the first one only. If you want any specific…
Q: Finding and Correcting Errors The below is the python program with line numbers given. This program…
A: Step 1: On the first line, the print function should be written in inverted commas.Step 2: On the…
Q: Find the error(s) in each of the following program segments. Explain how each error can be…
A: printf("%s \n",'Happy Birthday'); correct :- printf("%s \n","Happy Birthday"); printf("%c…
Q: Write a problem that counts the number of words in a sentence input by the user. Save it as…
A: Program code: import string def main(): #prompt the use to enter a sentance p = raw_input("Enter…
Q: Create a new version of the program below that uses Boolean expressions (not true of false) for…
A: A boolean expression is an expression that yields just the two outcomes: true or false. To relate…
Q: Please provide an appropriate introduction to the program and then explain the codes n =…
A:
Q: THE LARGEST NUMBER # read two numbers number1 = int(input("Enter the first number: ")) number2 =…
A: I am providing you the python program to print the largest among three numbers and to find a leap…
Q: Write a program that takes in an integer in the range 20-98 as input. The output is a countdown…
A: Solution :
Q: . The following pseudocode works, but it performs a case-sensitive validation of the user's input.…
A: Case sensitive: Typed input is sensitive to capitalization of letters. Example: "science" and…
Q: The following pseudocode works, but it performs a case-sensitive validation of the user’s input. How…
A: the answer is given below:-
Q: Q3/A- Estimate the result when you execute the following code by using Qbasic programming For m take…
A: Here is the result:
Q: import time import random name = input("Hello, what is your name? ") time.sleep(2) print("Nice to…
A: It is defined as a general-purpose, high-level, simple but effective object-oriented programming…
Q: cience P6.17 Radioactive decay of radioactive materials can be modeled by the equation A - A0e-log…
A: Given that: h=6 Formula: A=A0*e-t(log 2/ h) To calculate:…
Q: A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5…
A: def get_intro():…
Q: 4. A primary school is conducting a survey on the popularity of certain colours. Students ar asked…
A: The algorithm is a collection of a finite number of steps to perform a specific task. An algorithm…
Q: C++ Demonstration #4: What is the sample output of the program? double total = 0; int counter = 0;…
A: Here we are accepting the input grades till user enters -999 We have to keep track of the number of…
Q: Q1 (3 points): Trace the program and write the output, assume the user enters 2020 value for the…
A:
Step by step
Solved in 3 steps with 2 images
- Python please code I have so far: def print_menu(usr_str: str): aamenu_options = ['c', 'w', 'f', 'r', 's', 'q'] print('\nMENU') print('c - Number of non-whitespace characters') print('w - Number of words') print('f - Fix capitalization') print('r - Replace punctuation') print('s - Shorten spaces') print('q - Quit\n') aachoice = input('Choose an option: ').lower() while aachoice not in aamenu_options: print('Invalid choice') aachoice = input('Choose an option:') if aachoice == 'c': print('Number of non-whitespace characters:', get_num_of_non_WS_characters(usr_str)) elif aachoice == 'w': print('Number of words:', get_num_of_words(usr_str)) elif aachoice == 'f': usr_str, count = fix_capitalization(usr_str) print('Number of letters capitalized:', usr_str) print('Edited text:', count) elif aachoice == 'r': usr_str = replace_punctuation(usr_str) print('Edited text:', usr_str) elif…# Debug the following program and submit the CORRECT version ####### Lists names = ["chris","dan", "edgar", "bonnie", "al", "fran"] usernames = ["202999", "100345", "299999", "309890", "298765", "345678"] passwords = ["password", "password123", "abcdef", "asdfjkl;", "ilovemom", "abc123"] menuChoice = 0 # user's menu choice ###### functions def printList(list):# print listprintprint(list)print def displayMenu():# displays user-friendly, creative menu printprintprint("******* MENU *******")print("1. (D)isplay list 1 in original order")print("2. D(I)splay list 2 in original order")print("3. (F)ind an item in the list 1")print("4. (L)ogin")print("99. (E)xit")printprint def isFound(list, value):# finds a value in list returns True if found, False otherwiseif (value in list):return Trueelse: return False ###### main program while (menuChoice != "99"):displayMenu()menuChoice = input("Enter a menu choice: ")# handling menu choices if (menuChoice == "10" or menuChoice.upper().strip() ==…Create 7 (SEVEN) different Open GL programs. (use Geometric form (simple shapes in different colors , for example : car , home , and so on)) (Write each program code and its output. Also, reference links.)
- String spell = "Redikulus"; How would you find the index of the 'u' just before the last 's' using a single line of code? Multiple answers may be correct. Given the string String spell = "Redikulus"; How would you find the index of the 'u' just before the last 's' using a single line of code? Multiple answers may be correct. A. spell.substring(5, spell.length()).indexOf('u'); B. spell.indexOf('u', 5); C. spell.lastIndexOf('u'); D. spell.contains('u'); E. spell.indexOf('u', spell.length() - 2); F. spell.indexOf('u', spell.indexOf('l'));First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).Then create a new Java application called "RecursiveTriangle" (without the quotation marks) according to the following guidelines.Modify the example in Horstmann Section 5.9, pp. 228-230 so that the triangle displays “in reverse order” as in the example below, which allows the user to set the number of lines to print and the String used for printing the triangle.Use a method to prompt the user for the number of lines (between 1 and 10) to print. This method should take no parameters and return an int value. [CASE 2] Use a method to prompt the user for the string to be used when printing the pattern. This method should take no parameters and return a String value. [CASE 2] Use a method called printTriangle that takes an int and a String as parameters (i.e., the return values from the two methods mentioned above) and has no return value. That method should use…oks My library > CST 112: Introduction to Programming home > 2.11: Integer division and modulo 211.3. Integer alvision and moquio. ACTIVITY 477358 3451196.73zqy? Jump to level 1 Integer variables totalVolume and itemVolume are read from input. An item takes up itemVolume cubic inches, and the volume of a box is given by totalVolume cubic inches. Assign remainingVolume with the remaining volume after filling as many boxes as possible. Ex: If the input is 13 4, then the output is Remaining volume: 1 1 import java.util.Scanner; 2 3 public class RemainingVolume { 4 5 6 7 TO68L 9 10 11 12 13 14 15 16 17 } public static void main(String[] args) { } Scanner scnr = new Scanner(System.in); int totalvolume; int itemVolume; int remainingVolume; EzyBooks catalog ? Help/FA totalvolume = scnr.nextInt(); itemVolume = scnr.nextInt(); /*Your code goes here / System.out.println("Remaining volume:" + remainingVolume); 1 2 31
- Based on coding below, help me fix all the error until the program can be run properly and neatly #include <iostream>#include <iomanip>#include <ctype.h>#include <string> using namespace std; struct nodeBankAccount{string bank_acc_name;string bank_acc_num;double bank_acc_bal; nodeBankAccount*link;}; nodeBankAccount *head, *rear;nodeBankAccount *current;nodeBankAccount *newNode;nodeBankAccount *deleteBank;nodeBankAccount *previous;nodeBankAccount *found; void addBankAccount(){char answer;int insertOption; do{newNode = new nodeBankAccount; cout << "Fill in the details below" << endl;cout << "Bank Account Name: ";cin>>newNode->bank_acc_name;cout << "Bank Account Number: ";cin>>newNode->bank_acc_num;cout << "Bank Account Balance: " << "RM ";cin>>newNode->bank_acc_bal;newNode->link = NULL; if(head == NULL){head = newNode;}else{cout<<"Press 1 to insert the new record at front of the…/* 1. create a 4x4 crossword puzzle 2.make sure words like joy, bob,sun, bow are valid, 3.create a menu that lets the user search for a words and letters in the puzzle 4. only use iostream library " no string library" 5. use a header, class and driver for the structure Below is the givan code. append as you see fit */ #include using namespace std; class Puzzle { private: char arr[4][4] public: // constructor Puzzle() { char arr[4][2] = {'f', 'k', 's','s'} {'b', 'j', 'o','u'} {'b', 'o', 'b', 'n'} {'x', 'y', 'w', 'y'} } ~Puzzle(){ } search(){ } void print_all() { for (int row = 0; row < n; row++) for (int column = 0; c < ; column++) cout << arr[row][]; } }; int main () { return 0; }This is a program in C language. Help me debug this program. it has 3 errors. Please upload a screenshot also that it is working thank you./* This porgram uses the gotoxy() function and textcolor() for better screen display */ #include <iostream>#include <conio.h>#include <stdlib.h>using namespace std;main(){ int NoItem,ItemNo,Qty,ctr,Row=5; float UPrice,TAmt,ATendered,Change,APaid=0; char ItemDesc[15],TempChar; system("Color 5");; system("Color 2"); gotoxy(25,1);cout<< "[***] RICHLY SUPERMARKET [***]"; gotoxy(31,2);cout<< "Ayala Avenue, Makati"; gotoxy(6,4);cout<< "Item No. Description Qty. Unit Price Total Amount"; gotoxy(5,22);cout<< "No. of Item(s) Bought => [ ]"; gotoxy(37,22);cout<< "Total Amount to be Paid => "; gotoxy(37,23);cout<< "Amount Customer Tendered => "; gotoxy(37,24);cout<< "Amount of Change => "; gotoxy(31,22);cin>> NoItem;…
- PYTHON ONLYPlease finish off this movie collection progam/code a) define print_longest_moviesTo complete the interactive loop, you must instantiate a Movie object using the information provided by the user and add it to the MovieCollection object using the provided add_movie method.b) complete the interactive loop This method is to take no arguments and print the title and duration of the top three longest movies in descending order (i.e. highest to lowest). Additionally, each movie should be numbered in the output (i.e. the longest movie is 1, the second longest is 2, etc). Here's an example of output which could be produced when print_longest_movies is called: 1. Titanic (194 minutes)2. Vertigo (128 minutes)3. Jaws (124 minutes) the code: class Movie:def __init__(self, title, duration):self.title = titleself.duration = durationdef get_movie_duration(movie):return movie.durationclass MovieCollection:def __init__(self):self.movies = []def add_movie(self,…Question 6 sm .Write a program in python that collects a list of numbers from the user via the keyboard and calculates how many numbers are greater than Avery of all the numbers Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this lineWhy my code given me error’s # Python code to draw snowflakes fractal. import turtle import random # setup the window with a background color wn = turtle.Screen() wn.bgcolor("cyan") # assign a name to your turtle elsa = turtle.Turtle() elsa.speed(15) # create a list of colours scolor = ["white", "blue", "purple", "grey", "magenta"] # create a function to create different size snowflakes def snowflake(size): # move the pen into starting position elsa.penup() elsa.forward(10*size) elsa.left(45) elsa.pendown() elsa.color(random.choice(sfcolor)) # draw branch 8 times to make a snowflake for i in range(8): branch(size) elsa.left(45) # create one branch of the snowflake def branch(size): for i in range(3): for i in range (3): elsa.forward(10.0*size/3) # draw branch 8 times to make a snowflake for i in range(8): branch(slice) elsa.left(45) # create one branch of the snowflake def branch (size): for…