Exercise 5 Ask the user if they "love or hate" then take the input. If they answer with love then print out "I love python" 10 times first using the for loop then again but using the while loop. Otherwise, if they answer with hate then print out "I hate python" 10 times first using the for loop then again but using the while loop. If the user inputs anything else tell them "Why are you being a bad user?"
Q: Your task is to check whether java is perfectly installed on your computer or not. for this, you hav...
A: This program will help you out to get all properties of installed java in your system: package com.m...
Q: Find the logic error(s) in the following recursive function, and explain how to correct it (them). T...
A: def sum(n): if n == 0: return 0 else: return n + sum(n) Logical errors are If n == ...
Q: What is 34h AND ABh (3416 AND AB16)? Group of answer choices 1)56h (56₁₆) 2)43h (43₁₆) 3)35h (35₁₆) ...
A: 34h AND ABh (3416 AND AB16) is 43h (43₁₆) i.e. option B is correct
Q: True or False: Threads in the same process share a stack. Explain your response in as few words as p...
A: The straight forward answer for the above question will be False
Q: images for the last
A: Different clipart images can be inserted into word by using insert option Inserting the required cli...
Q: Python method for calculating the length of a String without the use of the len() function
A: Let us define a method called countLength() which accepts a user defined string as input and return ...
Q: Why was BASIC good in the past? Why have we moved to Python? Feature-by-feature, how powerful is BAS...
A: Lets see the solution in the next steps
Q: What are the intercloud challenges? [U]
A: Introduction: Intercloud, often known as a "cloud of clouds," is a theoretical model for cloud compu...
Q: Guide: How a Bill Becomes a Law Steps: 1. Bill Introduction a. Ideas and language for bils may come ...
A: Step:1 Bill Introduction (B) But only members of the house of representatives of the senate can intr...
Q: does the MLFQ scheduler ensure that interactive jobs are running quickly? (You should think about
A: Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling Prerequisite – CPU Scheduling, Multilev...
Q: Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. An example of t...
A: Algorithm: Start Read input and output file names Read shift Open input file and read the text and...
Q: ease do quick..
A: Converted given NFSA TO DFSA
Q: People who work with computers and humans use a lot of different ways to measure how well they work ...
A: Usability testing is a proven method to evaluate your product with real people. And usability testi...
Q: 15.a. How can a poorly attached connector affect signal strength in a fiber optic cable? A. Insertio...
A: Asper bartleby guidlines we are allowed to answer only one question please post them separately.
Q: need to print only the column on the left, how do I do this?
A: To print any column of dataframe we just need to call the function: df.iloc[:, (column number starti...
Q: A class Person is given below as your base class. Your task is to create a class Employee which will...
A: The solution to the given problem is below.
Q: Why is it a good idea to first write out an algorithm in pseudocode rather than jumping immediately ...
A: Answer:
Q: 1. If I'm using the and operator with two conditions that are both false, what is the boolean value?
A: For given two conditions like condition1 and condition2 with a (&&) ampersand symbol, if bot...
Q: ons of the benchmark is increased by 10% without affecting the CPI
A: given - Find the increase in CPU time if the number of instructions of the benchmark is increase...
Q: Give five (5) sample source code and simulations of Try Catch Java
A: try{ // code } catch(exception) { // code }
Q: What is the best course of action for dealing with the Denial of Service assault based on the iPremi...
A: Introduction: Denial of Service (DoS) assaults are on the rise and pose severe problems for cyber se...
Q: Give me an example of f formatted string in python. Take all the data from the user.
A: Python documentation states that... Formatted string literals (also called f-strings for short) let ...
Q: Can you conceive of scenarios where range controls and null value controls will enhance data integri...
A: Introduction: Data integrity is the act of ensuring the correctness and consistency of data througho...
Q: a TCP / IP client - server application in which o client will be able to request the execution of si...
A: Lets see the solution in the next steps
Q: fahrenheit = celsius*9/5+32 1. What is the order of calculations in the conversion of a temperature?...
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining ques...
Q: Given the two arrays below, write a C++ program to multiply the elements at the same index in both t...
A: Given: Arr1: [11, 23, -54, 41, 22, 10]Arr2: [-12, 45, -34, 121, 16, 4] Requirement: Write a C++ prog...
Q: ur task is to check whether java is perfectly installed on your computer or not. this, you have to p...
A: Lets see the solution.
Q: Write a C# program that using loops keeps asking the user to enter a number until the 5th even numbe...
A: I have provided C# CODE along with CODE SCREENSHOT and also provided OUTPUT SCREENSHOT...
Q: Using a single print command, print the list of odd entries in x and then the list of even entries i...
A: The following is the one-line statement which prints the odd elements and even elements: print([i ...
Q: What is the most popular programming interface and programming language for developers in the world'...
A: PROGRAMMING INTERFACE: An integrated development environment (IDE) is more than just a text editor....
Q: Without using any loop In PHP programming languague The value of the input variable is 9 3,5,578 How...
A: Here is your solution with an output.
Q: 2. Given the following NFA and E = {0, 1} State diagram for an NFA 0,1 1 92 93 Graßtate
A: Defined the given NDA generate the regular expression
Q: I'd like to send in a PowerPoint presentation to have the APA citations and references checked again...
A: Answer Include the name of the author (whoever presented the PowerPoint), the data it was delivered,...
Q: why is this html does not shows the "logout button ? how to fix it ?
A: You need to log in first then the "LogOut" button appears to you... When you log in then you see the...
Q: Write a Java program to convert the decimal number to binary number. Take the decimal number from th...
A: According to the Question below the Solution: Output:
Q: Give five (5) real life applications using Try-Catch
A: INTRODUCTION: The try-catch block in Java is used to manage programmatic exceptions. The code in the...
Q: Using the function from the previous problem, write a function durdle_game(target) which takes in as...
A: Please find the answer below :
Q: (GREATEST COMMON DIVISOR) The greatest common divisor of integers x and y is the largest integer tha...
A: code snippet:
Q: IN a flowchart Download the Flowgorithm file HazelsPartial.fprg and complete the program that calcul...
A: So in this problem, you have asked to write a program that calculates service charges for Hazel’s Ho...
Q: Give me an example of f form tted string in python. Take all the data from the user.
A: Given :- Give me an example of f formatted string in python. Take all the data from the user.
Q: What will be the output of the program ? #include int main() { int k=1; printf("%...
A: Here % d is for integer k that is k== 1. Now condition is checked with the help of ternary operato...
Q: Customer Support, Inc. (CSUP) is a large corporation with international clients that provides custom...
A: This object must have a uniqueId instance variable. Need all getters and setters and toString method...
Q: What role does the TCP/IP protocol play in LANs? Give two concrete examples.
A: Introduction: TCP/IP (Transmission Control Protocol/Internet Protocol) is a communication architectu...
Q: Using computers and other automated tools to grade true-false and multiple-choice tests is widesprea...
A: Some Suggestion on Above Question are Here: imagine taking a college examination, and, alternatively...
Q: Q.1: MIPS is an architecture having its own Assemb assembly Language. Differentiate between Assembly...
A: given - Q-1: MIPS is an architecture having its own Assembly Language. You are learning x86assembly ...
Q: he whole thing starts about twelve, fourteen or sev include include include sing namespace std; n...
A: Lets see the solution.
Q: iv) Define a Python function that takes an integer n as the parameter and returns true if n is in th...
A: Define a Python function that takes an integer n as the parameter and returns True if n is in the ra...
Q: What will be the content of 'file.c' after executing the following program? #include int main() { F...
A: This is the minified version of the code written. So the code written in a correct way is as under: ...
Q: Give me an example of f formatted string Ih nython Take all the data from the user.
A: f formatted strings are the strings that are easy to write the formatted pattern and we can include ...
Q: Suppose you have a table t with a column labeled 'XYZ. What is the difference between t.YYZ.cumsum()...
A: Answer: For each row of the table t.YYZ.cumsum() sum of the all values of the column XYZ. For each r...
Step by step
Solved in 3 steps with 1 images
- 1.Complete Steps 1-7 in the comments below. The remaining comments explain the logic. Customers can check a variety of loans and interest rates. When finished, type quit # Step 1: add an input statement to enter name or type quit to exit # Step 2: add a while loop to keep asking for a name until the user types quit # Step 3: declare two variables for loan and interest, like months below, # convert them to float, and ask the user to input their values to the screen. months = float(input("How many months will it take to repay your loan? ")) print("***************************************************************") print (name, "you requested an estimate on a loan for {0:.2f}" .format(loan)) # Step 4: add a print statement to display the interest and # of months print("*******************************************************************************") print("Here are the rates for simple interest, compound interest, and monthly interest", "\n")…In a loop when a condition is false you come out of the loop. However, interesting things happen when the condition is true and you remain in the loop. What kinds of interesting things happen discuss with arguments. Course: Formal Methods in Software EngineeringPlease don't copy from other website Complete the program below, so it works. User enters amount to invest, interest percentage and number of years. Enter amount to invest: 200 Enter interest percentage: 0.10 Enter number of years: 2 Year: 1 Interest: 20 Year: 2 Interest: 20 Total Amount thus far: 220 Total Amount thus far: 240 The while loop runs according to the user input. Interest is calculated by multipling the user amount by the interest percentage. double amount, interestPerc, interest; int years; int i; Console.Write("Enter amount to invest: "); amount = double.Parse(Console.ReadLine(); Console.Write("Enter interest percentage: "); %3D interestPerc = double.Parse(Console.ReadLine()); Console.Write("Enter number of years: "); %3D years = int.Parse(Console.ReadLine()); Console.WriteLine(); %3D interest = [A] %3D [B]
- Complete the program below, so it works. User enters amount to invest, interest percentage and number of years. Enter amount to invest: 200 Enter interest percentage: 0.10 Enter number of years: 2 Year: 1 Interest: 20 Year: 2 Interest: 20 Total Amount thus far: 220 Total Amount thus far: 240 The while loop runs according to the user input. Interest is calculated by multipling the user amount by the interest percentage. double amount, interestPerc, interest; int years; int i; Console.Write("Enter amount to invest: "); amount = double.Parse(Console.ReadLine(); Console.Write("Enter interest percentage: "); %3D interestPerc = double.Parse(Console.ReadLine()); Console.Write("Enter number of years: "); %3D years = int.Parse(Console.ReadLine()); Console.WriteLine(); %3D interest = [A] %3D [B]Sample output This is from one continuous run of the program. Please enter a product name. You can also enter x to quit: laptop Please enter the product's category: tech Please enter the product's price: 100 The new SKU is LAP and the new price is 110.00000000000001 Please enter a product name. You can also enter x to quit: scantron Please enter the product's category: office Please enter the product's price: .75 The new SKU is RON and the new price is 0.8250000000000001 Please enter a product name. You can also enter x to quit: whiteboard cleaner Please enter the product's category: other Please enter the product's price: 8 The new SKU is WHITEBOARD CLEANER and the new price is 8.8 Please enter a product name. You can also enter x to quit: xOverview This program will prompt a user for a start and a limit, it will then while-loop through, doubling the iterator each pass, until the limit is reached. Expected Output Example 1 Enter the start of the loop: Enter the limit of the loop: 25 The current value is 3 The current value is 6 The current value is 12 The current value is 24 The last value of current that was less than 25 was 24 Example 2 Enter the start of the loop: 25 Enter the limit of the loop: 102 The current value is 25 The current value is 50 The current value is 100 The last value of current that was less than 102 was 100 Specifications • You should submit a single file called M5A2.py • It should follow the submission standards outlined here: Submission Standards Your program populate an integer named start using input • Your program populate an integer named limit using input Your program must use an iterator named current Your program must move through the values using a while-loop Tips and Tricks That last…
- Question 2 Take an input from the user, if input is between 20-40, print all even numbers from 30 - 40 by using for loop otherwise print the message "Try again".PYTHON PROGRAMMING ONLY. Please provide explanation as well. Thank you. Write a while loop that lets a user enter a number less than 10. If the number inputted exceeds 10, print an error and ask for the number again, in which a user may enter the same or a different number. When the user inputs a valid number, the number should be incremented by 5, and the result assigned to a variable named sum. This loop should continue to iterate as long as the sum totals less than 50. When sum exceeds 30, it should print "Almost there..." until it reaches or exceeds 50. Once it does, print out "your final sum is (replace with final sum)". For example, if the sum is currently 45 and the user inputs 4, the program will not enter the loop again since the new sum will be 54 and should then print "your final sum is 45".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 python
- Write the code to display the following pattern using two pretest loops along with the letter X. Use the Do...Loop statement for the outer loop. Use the For...Next statement for the nested loop. Display the pattern in the lblPattern control.XXXXXXXXXXXXBasic while loop expression. Write a while loop that prints userNum divided by 4 (integer division) until reaching 2 or less. Follow each number by a space. Example output for userNum = 160:40 10 2 Note: These activities may test code with different test values. This activity will perform four tests, with userNum = 160, then with userNum = 8, then with userNum = 0, then with userNum = -1. See "How to Use zyBooks".Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.In python, A customer in a store is purchasing items. Write a program, using a while loop, that asks for the price of each item, then displays the subtotal of the sale, the amount of sales tax, and the total when the customer is done entering all the items. Assume the sales tax is 7 percent. The customer should be allowed to enter as many items as they wish. The while loop should terminate when the user hit the key (Return) on the keyboard. (Hint: Use a null or empty string). Optionally, if you would like to round the dollar amount to two decimal places, you can use output formatting construct in your print statement. For example: print("Sales tax: ", format(sales_tax, '.2f')) will round to two decimal places. Expected Output: Enter the item price or <ENTER> to end: 22.50Enter the item price or <ENTER> to end: 1.99Enter the item price or <ENTER> to end: 45.30Enter the item price or <ENTER> to end: 70Enter the item price or <ENTER> to end: 5Enter the item…