PART 2) BRANCHING Write a quadratic equation solver. Ask the user to type in three numbers: a, b, and c. Then find the value of d = b2 – 4 ·a·c If the value d is bigger than zero tell the user that there are 2 roots If the value of d is exactly zero, then tell them that there is one root. If the value is negative, then tell them that there are no real roots. o Note that you don't have to find the roots, just tell them how many there are.
Q: 1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: Language: JAVA Leap-Year Write a program to find if a year is a leap year or not. We generally…
A: import java.io.*;import java.util.*;class LeapYear { public static void main(String args[]) throws…
Q: (PYTHON) A nutritionist who works for a fitness club helps members by evaluating their diets. As…
A: - We yave to help the nutritionist with the code.
Q: Archery Scorer. Write a program that draws an archery target (see Pro-gramming Exercise 2 from…
A: below is the python code:
Q: Financial application: compare loans with various interest rates) Write a program that lets the user…
A: Actually, program is a executable software that runs on a computer.
Q: Assignment Description This program will simulate part of the game of Yahtzee! This is a dice…
A: Python code: yahtzee.py:
Q: Credit Card Number CheckThe last digit of a credit card number is the check digitwhich protects…
A: Note : I have used java programming language since it is not mentions which language to be used to…
Q: Description Write a program that asks the user to enter an amount of money in the format of dollars…
A: Program: # Asking for a dollar and cent amount from the user # Prompting a message to enter a amount…
Q: Write a program that prompts the user to enter the number of hours a car is parked at the airport…
A: Assuming the formula, Parking fee, F is calculated as 5, 0 ≤ h ≤3F = {6 ×int (h+1),…
Q: Part B: Chore Bonus Your parents pay you $3 for each trash bag full of leaves you rake. If you can…
A: According to the information given:- We have to follow the instructions mentioned to get the desired…
Q: Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so the…
A: Program: // Import the required packagesimport java.util.Scanner;import java.lang.String;// Class…
Q: 2) triangle.py Write a program that will ask the user to input three positive numbers in descending…
A: Given, 3 numbers from the user which are descending in nature. Let us consider those 3 numbers are…
Q: Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so the…
A: Python: It is one of the easiest programming language. It is a concise (less)code. It is a…
Q: 10. Future Value Suppose you have a certain amount of money in a savinggs account that earns com-…
A: Required:
Q: Dice game Rules of the game: The players roll three dice, and the program adds the sides that turn…
A: Coded using Python 3.
Q: 9: perfect.cpp) A number is called perfect if the sum of its divisors is equal to the original…
A: #include <iostream>using namespace std; const int LIMIT = 5000; int sumOfDivisors(int); int…
Q: 7) Solving quadratic equation program Let's consider the general formula of a quadratic equation :…
A: Required: Python program to solve the quadric equation. Required code with comments for…
Q: Bad News Bearers Introduction There is some bad news to be delivered, and X has taken on the…
A: Answer: Step 1(INTRODUCTION) This is a basic programming problem named "Jospehus Circle" Since…
Q: C++ Programming point* go_far(point* other) Return the point bearing the x- and the y- coordinates…
A: Algorithm: Start Implement a struct point with 2 struct variables x,y Inside the struct implement…
Q: T/F 9) The assignment statement d = p; is legal even though d is not a Poodle.
A: Please find the answer to the above question below:
Q: C++ Programming Problem: To make telephone numbers easier to remember, some companies use letters…
A: A required C++ program is as follows, File name: “main.cpp” #include <iostream> using…
Q: 5. Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so…
A: Python program code: a=input("Enter a telephone number XXX-XXX-XXXX: ") #user inputb=a.split('-')…
Q: C++ Demonstration #3: Create a program that will arrange the values c A, B and C in ascending order…
A: #include <iostream>using namespace std; int main(){ //Sort three numbers. int A =…
Q: function/method Write a program that asks the user for his first name and then prints it using a…
A: Code: import java.util.*;public class Main{ void printName(String s){…
Q: C++ A dice game called "21" It is a variation on BlackJack where one player plays against the…
A: Write a C++ program that will find the output according to the conditions given in the question and…
Q: Explain the results when you XOR something with itself. For example, A XOR A.
A: XOR GATE: XOR gate is basically a logical gate which gives the output as TRUE only when the number…
Q: Write a loan calculator program that computes both monthly and total payments for a given loan…
A: As no language was mentioned, So, solving with C++. #include<iostream> using namespace std;…
Q: - First and Last Design a program that asks the user for a series of names (in no particular order).…
A: Python code to print the first and last name from user input names is given below.
Q: Evaluation (Factorial of a Number) Write a program that calculates the tactorial of a number using…
A:
Q: B is K ∴ No K is J Convert the following argument into symbolic form and then determine whether it…
A: Lets see the solution.
Q: 2.15 (Geometry: area of a hexagon) Write a program that prompts the user to enter the side of a…
A: here in this question we have asked to write a program which take hexagon side from the user and…
Q: LAB 7-5 Desk-Check The code shown in Figure 7-45 should display the numbers 2, 4, 6, 8, 10, and 12…
A: #include<iostream> using namespace std; int main(){ for(int number=2;…
Q: Microwaves / Radio Waves If a scientist knows the wavelength of an electromagnetic wave she can…
A: Source Code: #include<iostream>using namespace std; int main(){ cout<<"Enter…
Q: circles) Write a program that prompts the user to enter the center coordinates and radii of two…
A: Here is the Java program according to the problem given: import java.util.Scanner; public class…
Q: 5-WRITE A PROGRAM THAT CALCULATES A STUDENT'S AVERAGE IF IT IS LESS THAN 50, SPECIFYING THE…
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other…
Q: 1. Write a pyrhon program that prints out a classic hangman stick figure. The program should ask the…
A: Answer :
Q: Python Assignment: In India McDonald's has the n number of customers and they are famous for their…
A: Coded in Python 3.
Q: Write a program that will ask for a sentence and letters to cross out. It should then print the…
A: The question is to write C++ code for the given problem.
Q: Problem Description: The bird of paradise called the Helipixsal is renowned for its magnificent tail…
A: lengths of feathers looping conditions output Explanation: The code is: def main(): num_feathers =…
Q: C++ code Assignment: While still in school, Sam had the ability to solve problems. Now one of his…
A: As per the given problem we are required to develop a C++ to solve the given number problem. For…
Q: Ground rules for this task: • You can only use Boolean operators, numerical comparisons, and the abs…
A: I have implemented the given instructions in python. The code is as follows: import math x: float…
Q: (Dice Rolling) Write a program that simulates the rolling of two dice. The program should use rand…
A: #include <stdio.h>#include <stdlib.h>#include <time.h> int main() {…
Q: Day of the Week Calculator For this assignment you will write a program that will allow you to enter…
A: To find the day of a given number in Java, the date is given as input, we will use Calendar class,…
Q: Credit Card Number Check. The last digit of a credit card number is the check digit, which protects…
A: Program approach: import the necessary packages required for scanning the input from user create a…
Q: Q1 Write T if the sentence is true and F if the sentence is false and correct the false sentence.…
A: Note - As per the guidelines we are only allowed to answer 1 question with three sub parts at a…
Q: (Geometry: area of a pentagon) Write a program that prompts the user to enter the length from the…
A: Note: Due to company policies I am compelled to solve only one question and that is the first…
Q: 3. The formula for determining compound interest is: A represents the amount to earn; P is the…
A: According to bartleby guidelines we need to answer only one question so i have answered first…
Q: C Program / C Language Make a C program. The date is january 1, 2019. Cody has a lot of neighbors…
A: Here, I have to write a C code to the above question.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- Computer Science Question Lab There is only one list of N ingredients in the menu. Every ingredient has its beauty value that does not depend on its taste, but on the way it looks, which is expressed as a positive integer. To order a dish, the customer asks Ramsay to use all the ingredients from L to R (L is strictly less than R). Ramsay knows that the dish will be tasty and not only beautiful if the sum of its ingredients' beauty values is divisible by K. Ramsay does not want to use all the ingredients, so he always excludes one of them. Which one? - The least beautiful one! (in other words - which has the minimal beauty value). Now he wonders - how many segments (L,R) are there such that the sum of their beauty values will be divisible by K after excluding the least beautiful ingredient. Your assignment is to develop a python code that prints the answer for the problem. Sample test case are given below:Input:3 51 2 3Output:1How to attempt? Question : The Card Game One day, Fred and his N friends were playing a card game in which each player throws a card with a number written on it. The cards are such that a number X is written on front of the card, and the negative of that number is written on the back side of the card. This game has the following rules: - Each of the N players is asked to throw a card. After all the N cards are thrown, Fred has to flip one or more cards in consecutive order, only once. Your task is to help Fred flip the cards in such a way that the sum of the numbers, on front face of the cards, is the maximum.Problem Description: In the Whimsical Library, each book is enchanted with a magical code to ensure the protection of knowledge. The validation process for these magical codes involves a combination of mathematical spells. The validation process is described as follows: Take the sum of the digits at odd positions from left to right. Take the sum of the squared digits at even positions from left to right. If the absolute difference between the results from step 1 and step 2 is a prime number, the book code is considered valid; otherwise, it is invalid. Example 1: Consider the magical book code 86420137. Step 1. Take the sum of the digits at odd positions from left to right. 8+4+0+3=15 Step 2. Take the sum of the squared digits at even positions from left to right. 6^2+2^2+1^2+7^2=36+4+1+49 = 90 Step 3. If the absolute difference between the results from step 1 and step 2 is a prime number. 115-901 75 (not a prime number) Book code 86420137 is invalid. Example 2: Now, let's examine the…
- Matric Number: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your matric number. If the first digit of y is 0, replace it with 2. Ехатple: If you matric number is 2013034, Thus, x = 201 and y = 234 a. Write the values of x and y based on your matric number. b. If a = x (mod 7) and b = (-1) + y (mod 7), find the integer(s) c with 10* Question Completion Status: A Moving to another question will save this response. Question 9 Given the function F(X,Y,Z) =XZ + Z(X'+ XY), the equivalent, most simplified Boolean representation for F is O a. Z+XYZ O b.XZ O c. Z O d.Z+YZ A Moving to another question will save this response. مشمس 36°C9: perfect.cpp) A number is called perfect if the sum of its divisors is equal to the original number. A number is called deficient if the sum of its divisors is less than the original number. A number is called abundant if the sum of its divisors is more than the original number. Write a program that answers the following questions: What numbers below 5000 are perfect? What odd numbers below 5000 are abundant? What are the relative proportions of deficient, abundant, and perfect numbers? 5000 should be in a global constant.Background: Game Rules The rules to the (dice) game of Pig: You will need 2 dice. To Play: a. The players each take turns rolling two die. b. A player scores the sum of the two dice thrown (unless the roll contains a 1): If a single number 1 is thrown on either die, the score for that whole turn is lost (referred to as “Pigged Out”). A 1 on both dice is scored as 25. c. During a single turn, a player may roll the dice as many times as they desire. The score for a single turn is the sum of the individual scores for each dice roll. d. The first player to reach the goal score wins unless a player scores higher subsequently in the same round. Therefore, everyone in the game must have the same number of turns. Execution and User Input This program is quite interactive with the user(s) and will take in the following information; please review the sample input / output sessions for details; we describe them again here emphasizing input. The program will prompt for the number of…Computer Science Question LabThere is only one list of N ingredients in the menu. Every ingredient has its beauty value that does not depend on its taste, but on the way it looks, which is expressed as a positive integer. To order a dish, the customer asks Ramsay to use all the ingredients from L to R (L is strictly less than R). Ramsay knows that the dish will be tasty and not only beautiful if the sum of its ingredients' beauty values is divisible by K. Ramsay does not want to use all the ingredients, so he always excludes one of them. Which one? - The least beautiful one! (in other words - which has the minimal beauty value). Now he wonders - how many segments (L,R) are there such that the sum of their beauty values will be divisible by K after excluding the least beautiful ingredient. Your assignment is to develop a python code that prints the answer for the problem. Sample test case are given below:Input:3 51 2 30utput:1Problem D: Different Dice Game Consider the following game for two players: The first player rolls a pair of dice of fair six-sided dice. If the two dice show different numbers, the player's score is the larger of the two numbers. Otherwise, the player's score is the sum of the two numbers. At this point, the player is asked if they want to remove their lower die and re-roll one die. If they say no, the player keeps her score and their turn is over. If they say yes, then they roll one more die and the number showing on this die replaces the lower of the original two rolls. Then these two dice rolls are scored accordingly. (For example, if the initial roll was a 2 and 5, if the player doesn't roll again, she gets 5 points. If she does roll again and obtains a 4, her score is still 5. If she rolled again and obtained a 6, her score would be a 6. If she rollwed again and obtained a 5, her score would be a 10.) The second player goes after the first, doing the exact same steps as the first…Credit Card Number Check. The last digit of a credit card number is the check digit, which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for numbers with 8 digits instead of 16:• Starting from the rightmost digit, form the sum of every other digit. For example, if thecredit card number is 4358 9795, then you form the sum 5 + 7 + 8 + 3 = 23.• Double each of the digits that were not included in the preceding step. Add all digits ofthe resulting numbers. For example, with the number given above, doubling the digits,starting with the next-to-last one, yields 18 18 10 8. Adding all digits in these valuesyields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27.• Add the sums of the two preceding steps. If the last digit of the result is 0, the number isvalid. In our case, 23 + 27 = 50, so the number is valid.Write a program that implements this…Credit Card Number Check. The last digit of a credit card number is the check digit, which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for numbers with 8 digits instead of 16:• Starting from the rightmost digit, form the sum of every other digit. For example, if thecredit card number is 4358 9795, then you form the sum 5 + 7 + 8 + 3 = 23.• Double each of the digits that were not included in the preceding step. Add all digits ofthe resulting numbers. For example, with the number given above, doubling the digits,starting with the next-to-last one, yields 18 18 10 8. Adding all digits in these valuesyields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27.• Add the sums of the two preceding steps. If the last digit of the result is 0, the number isvalid. In our case, 23 + 27 = 50, so the number is valid.Write a program that implements this…Exercise II Write a program that finds the positive integer solutions of the following equation ax³ + bx² + cx' + d = 0. The user enters the values of coefficients a, b, c and d. The program should test each integer starting from -50 to 50, and each time the equation is equal to zero, it prints its value as well as "is a solution". At the end, it displays the total number of positive integers found. Note that if the equation has more than one solution, the plural word “solutions" is used in the output. Sample run 1: Enter the coefficient of a, b, c, d: 1 -8.5 21 -13.5 1 is a solution 3 is a solution The equation has 2 integers as solutions Sample run 2: Enter the coefficient of a, b, c, d: 6 48 103.5 67.5 The equation has no integer solutions Sample run 3: Enter the coefficient of a, b, c, d: 1 -1 -12 0 4 is a solution The equation has 1 integer solutionSEE MORE QUESTIONS