Problem 2 (Calculations) Write a program called p2.py that implements a tip calculator. Your program should ask the user for the bill amount (float) and the percentage of the tip (float). You can assume that the user will always enter valid input. Your program then should output (i) the dollar amount of the tip and (ii) the final bill in three different formats. See sample outputs below. User input is highlighted for emphasis. Sample Output - 1 Enter the bill amount: 27.95 Enter tip percentage: 17 A 17.0% tip on $27.95 equals $4.7515 The total bill is: 32.701499999999996 The total bill is: $32.7 The total bill is: $32.70
Q: Describe how to maintain the outcomes of the insertions and deletions made in the following ways in…
A: In an incremental approach, the following operations are performed on insertions and deletions:…
Q: - Calculate Income Tax Problem Statement A program is required to determine to calculate the…
A: Because no programming language is mentioned I will be writing code in python and c++
Q: 3. Transform Entity Relationship diagram in Figure 1 below to a relational schema (relational…
A: Editable source code: --Table Creation of Entity Postion--Setting PID as Primary KeyCREATE TABLE…
Q: listx=["add","sub", "div"] string="" for c in range (len (listx)) : string = ", "+ listx [c] print…
A: Here is the complete code of above problem. See below steps.
Q: Write a statement to hide the control.
A: Create a form in VB Insert a PictureBox control by dragging it from the palette to the form.In the…
Q: What type of possible error messages you can get when you try to lo
A: The answer is
Q: 3. Transform Entity Relationship diagram in Figure 1 below to a relational schema (relational…
A: i will give this question answer in next step
Q: Has a catchphrase been used? What exactly does a finally clause mean? How do catch and finally…
A: In this question we have to understand about the finally and catch blocks in the java program. Let's…
Q: Toss of a Coin Write a program that simulates the toss of a coin. The program asks the user to input…
A: We need to write a code for simulating coin toss. *The programming language used is C++.
Q: Write a void function SelectionSortDescendTrace() that takes an integer array and sorts the array…
A: Hi please find the solution below and I hope it would be helpful for you.
Q: Determine the most significant advantages and drawbacks of educational information systems.
A: INTRODUCTION: What information systems do in the education field: An information system is a group…
Q: What are the drawbacks of using a key management system for symmetric encryption?
A: The answer to the question is given below:
Q: How would you choose between using an ORM framework and a traditional SQL-based API like ODBC/JBDC…
A: JDBC stands for "java database connectivity,": And it is an application programming interface that…
Q: What trade-offs do buffer trees have in comparison to LSM trees?
A: The buffer tree has the following trade-offs: To reduce the costs of inserting new data and updating…
Q: 1. Consider the algorithm for the sorting problem that sorts an array by counting, for each of its…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Write a single BASH pipeline which will output number of processes owned by the root user currently…
A: The following is the shell command to output the number of processes that are running by the user…
Q: What are a few real-world uses for Splay tree?
A: A splay tree can be used as a cache, a set, or a map. A cache is a data structure that stores a set…
Q: How are two separate connections between a field label and a control element possible? Please also…
A: label Field: A string may be stored as the value of a label field, while another string can be…
Q: Q 3 Computer Science Computer networks What is the theoretical maximum number of connections…
A: The answer is given below step.
Q: In this assignment you create a personal bio in a OneDrive program. You will then place the document…
A: To create personel bio in a one drive program
Q: 14) The C++ compiler requires that a function prototype or function definition preceed any function
A: Function prototype means name of function along with its parameter and return type. For example…
Q: Think about the myPicture PictureBox control included in an application's GUI. Write a statement to…
A: The Visible property of a PictureBox: An image control known as a "PictureBox" may be used to show a…
Q: Write a program that accepts 10 integers from the user using loops and then displays the product of…
A: code- p1=1p2=1for i in range(10): n=int(input("Enter a number "+str(i+1)+" :")) if n<4:…
Q: Implement the following pseudocode in assembly language program. while (val1 < val2) {…
A: Assembly language:- The Assembly language is also known as assembler language It is a low-level…
Q: Why is hashing passwords preferable than encryption when keeping them in a secure location?
A: Introduction Passwords must be kept secure so that they cannot be accessed by an attacker, even…
Q: List and explain the safeguards that businesses use to preserve the integrity of their partners,…
A: Introduction: Implementing Organizational Integrity aims to manage an organization's activities and…
Q: What three key performance indicators (KPIs) may a medical or dental office use to gauge how well a…
A: KPIs: KPIs stands for Key Performance Indicators. It is important to understand the performance of…
Q: What are the traits of perplexity and difussion in connection to cryptographic procedures, and how…
A: Dispersion and muddle: Two aspects of a safe cipher's functioning are confusion and dispersion.…
Q: What are the functional key differences between a virtual switch and a virtual distributed switch?
A: In this question we need to explain the differences between virtual and distributed virtual switch.
Q: Where in the actual world may one find the theoretical foundations of information systems?
A: Information systems in enterprises have three roles. IS business apps aid companies with operations,…
Q: Show off your understanding of prototyping.
A: Answer: Prototyping is an experimental process where configuration groups carry out thoughts into…
Q: The two-tier and three-tier application architectures should be defined. Which is more advantageous…
A: In this question we need to explain the two-tier and three-tier architecture in Database Management…
Q: Section C Practical Instructions: Use Codeblocks/www.onlinegdb.com to write programs. Copy and paste…
A: The following are steps need to be taken for the given program: Declare integer variables for loop…
Q: How long will a variable that is defined in a Click event handler last?
A: the duration of a variable The addEventListener () function attaches an event handler to the given…
Q: Comparisons and contrasts are made between test data, an integrated test facility, and parallel…
A: Dummy transactions are created by the auditor and processed by the client's computer programme while…
Q: Instructions: Section C Practical Use Codeblocks/www.onlinegdb.com to write programs. Copy and paste…
A: Here is the c code of the above problem. See below step for code.
Q: 12. If some resources have only a single instance, then we can use the wait-for graph. True False
A: wait for graph: This graph is used to avoid deadlock and identify the deadlock.
Q: How are the computer functions used by Apollo computers similar to today's computers? what is the…
A: Answer :-
Q: What precisely does the term "shared responsibility paradigm" entail in the context of cloud…
A: Here are my thoughts on the shared responsibility concept. In terms of rules, methods, and controls,…
Q: A new architecture, with N layers, is proposed. User application at the top layer generates a…
A: We have a total of N layers.. The message generated at the top layer is M bytes.
Q: Prove that there are real numbers a and b such that √a + b = √a + √b.
A: According to the information given:- We have to prove that there are real numbers a and b such that…
Q: A government organization decides that in order to protect the communications it has with its…
A: A "proprietary" product is protected by its owner. Proprietary cryptography algorithms are the same.…
Q: There are several ways that malicious traffic might be diverted into a network, including from one…
A: Introduction: VLAN hopping is the practice of attacking the network resources of a virtual local…
Q: Why is having a database of encrypted passwords better than hashing passwords that are kept in a…
A: Introduction:- Each user account might be accessed if a thief obtained access to the database and…
Q: The term "cassette drive" refers to a conventional cassette recorder that is used to load data into…
A: Compact cassette The Compact Cassette (MC), also known as the Musicassette (MC), is an analogue…
Q: Where in the actual world may one find the theoretical foundations of information systems?
A: Introduction: Information systems in enterprises have three roles. IS business apps aid companies…
Q: In the von Neumman model, the PC is used to store: A. The data to use in executing the instruction O…
A: Von Neumann An arithmetic unit, a programme control unit, a single bus enabling memory access, and a…
Q: Why don't we simply use magnetic tape as our main medium of storage instead of any other choices?
A: The solution to the given question is: Magnetic tape is a storage medium that consists of a thin…
Q: Explain why the concept of mutual exclusion (ME) is seen as a crucial mechanism for an operating…
A: The concept of mutual exclusion (ME) is seen as a crucial mechanism for an operating system's…
Q: how do i create a method that adds instances from a class into a singly linked list(java)
A: Answer : Inserting a new element into a simply linked list at the beginning is fairly simple. We…
Step by step
Solved in 6 steps with 4 images
- (Electrical eng.) a. The voltage gain of an amplifier is given by this formula: voltagegain=[275 23 2 +0.5 f 2 ]n f is the frequency in Hz. n is the number of stages in the amplifier. Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display: At a frequency of xxxxx hertz, the voltage gain is yyyyy Your program should replace xxxxx with the frequency and yyyyy with the voltage gain. b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.C Program In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P8.5 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.C++ Programming Exercise: The population of town A is less than the population of town B. However, the population of town A is growing faster than the population of town B. Write a program that prompts the user to enter the population and growth rate of each town. The program outputs after how many years the population of town A will be greater than or equal to the population of town B and the populations of both the towns at that time. (A sample input is: Population of town A = 5,000, growth rate of town A = 4%, population of town B = 8,000, and growth rate of town B = 2%.)
- PYTHON (Uee While Loop) only Write a python program that calculates the populations of foxes and rabbits who live within a certain area of land, as that number changes from year to year. It will take the initial populations as inputs, and then proceed to calculate the year-by-year changes. The following is derived from the “Lotka-Volterra equations”, which you may look up if you desire. Essentially, we will model the foxes and rabbits with 4 constants, and 2 data structures of year-by-year values. They are defined as follows: r[y] # of rabbits in year y f[y] # of foxes in year y α or alpha - birth rate of rabbits β or beta - death rate of rabbits, dependent on # of foxes γ or gamma - birth rate of foxes, dependent on # of rabbits δ or delta - death rate of foxes, caused naturally The formulas we will use are: r[y]=r[y−1]+(r[y−1]×α)−(r[y−1]×f[y−1]×β)r[y]=r[y−1]+(r[y−1]×α)−(r[y−1]×f[y−1]×β) f[y]=f[y−1]+(f[y−1]×r[y−1]×γ)−(f[y−1]×δ)f[y]=f[y−1]+(f[y−1]×r[y−1]×γ)−(f[y−1]×δ) However,…(a) The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help a student learn multiplication.Use the rand function to produce two positive one-digit integers.The program should then prompt the user with a question, such asHow much is 6 times 7?The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again." and let the student try the same question repeatedly until the student finally gets it right. A separate function should be used to generate each new question.This function should be called once when the application begins execution and each time the user answers the question correctly.(b) A prime integer is any integer greater than 1 that can be divided evenly only by itself and 1. The Sieve of Eratosthenes is a method of finding prime numbers. It…Problem 3 Rolling Two Dice (in c language) Write a program that simulates the rolling of two dice. The program should use rand twice to roll the first die and second die, respectively. The sum of the two values should then be calculated. [Note: Because each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 the least frequent sums.] Figure 6.24 shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable; i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7.
- PYTHON (Do not use functions) Write a program using a Loop structure that takes 5 inputs of sales for item 1 – item 5 from the user during runtime. The program use Running -Total to calculate the sales. The program applies 7% SalesTax The program gives a discount of 5% if the total sales are greater than $6000 The program gives a discount of 6% if the total sales are greater than $7000 The program validates the input as numbers only (Must Enter a Number) Provide different outputs to cover (1-6) The 5 items entered for sales calculations The subtotal of sales without taxes The total sales with taxes The final total of no discount < $6000 The final total of discount if sales > $6000 The final total of discount if sales > $7000[PYTHON LANGUAGE] You are planning an outing with some friends and need to calculate the total price of the tickets. A regular ticket usually costs $3.99 and a stu- dent ticket costs only $2.99. If the total number of tickets being ordered (including both students and regular tickets) is at least 10, then a 10% discount is applied to the order. However, if it is a holiday, then the at-least-ten group discount is only 5% (not 10%). Write a program that takes three lines of input: the number of reg- ular tickets, the number of student tickets, and an integer indicating whether it is a holiday (1) or not (0). It prints a float giving the total cost. Be sure to define and use constants for REGULAR TICKET PRICE and STUDENT TICKET PRICE. Write your program in a file named tickets.py.*Modify the program so that the user will error trap for only 1 and 0 as an input. *If the user enters an input other than 1 or 0 display an error message and request the user enter that input again. *Do this for all inputs in the code. # User defined function for logic OR# The function takes two parameters and returns a single intdef OR(a: int, b: int)->int:# If a is equal to 1 return 1if a == 1 :return 1# If b is equal to 1 return 1elif b == 1 :return 1# If a and b is equal to 0 return 0else :return 0 # User defined function for logic NOR# The function takes two parameters and returns a single intdef NOR(a: int, b: int)->int:# If a is equal to 0 and b is also equal to 0 return 1if a == 0 and b == 0 :return 1# If a is equal to 0 and b is equal to 1 return 0elif a == 0 and b == 1 :return 0# If a is equal to 1 and b is also equal to 0 return 0elif a == 1 and b == 0 :return 0# If a is equal to 1 and b is also equal to 1 return 0elif a == 1 and b == 1 :return 0 # User defined…
- Problem Statement – Construct a program that calculates the course overall grade point average (GPA). The program must input 3 scores for each of the categories listed in the calculation of the GPA provided below with exception of the final examination. The maximum score for all quizzes is 20 points each, the maximum score for all homework assignments is 50 points each, the maximum score for all tests and all programming assignments is 100 points each, and the maximum for the final examination is 120 points. You can select the scores that you make on each of these assessed items.Q2) Write a ladder program for parking system with the following specification: 1- The parking system needs to know how many cars entered the parking area during the day. 2- The parking system can accommodate five cars only, it has two sensors (in the entrance gate and exit gate). 3- A yellow lamp is ON for 30 Sec when the number of car equal to five (indicating the parking is full), then if no car is exit the system close the entrance gate until one of the cars exit the parking. O 4- When the total number of cars that entered the parking during the day equal to 20 the system closes the entrance gate and a screen is ON to show the state of parking on screen" parking is close" the screen remains ON until the system reset.PROBLEM: Write a program that computes the equivalent resistance of a purely series and purely parallel electric circuit. SPECIFICATIONS: • The program will ask the user to choose whether to compute for the equivalent resistance of a series or parallel combination. • The user will input three resistance values R1, R2, and R3 in ohms. • The program will provide an output of equivalent resistance in series (Rs) or parallel (Rp). • You may only use the codes that we studied in our lectures. • All lines of codes should have a comment. To recall, the formula for solving the resistance for a purely series and purely parallel circuit are: a. Series Circuit: R1 120 ohms R2 Vs 100 V Rs = R7 = R1 + R2 + R3 + …+ Rn ... 30 ohms R3 50 ohms b. Parallel Circuit: 1 1 1 + R1' R2 ' R3 1 1 1 ... Rp RT Rn R1 R2 10 ohms Vs 40 ohms 40 Volts TEST CASES: If the user inputs a character: Computing for the equivalent resistance A. Series Combination B. Parallel Combination Enter Choice: B Enter R1: 1 Enter R2: 2…