O Problem program.py > haircolor=str(input("What color is your hair? ")) eyeColor = str(input("What color are your eye? ")) print("you have " +hairColor + " hair and " + eyeColor + " eyes."); Write a program that asks the user about themselves then prints out a summary like this: What colour is your hair? pink What colour are your eyes? blue You have pink hair and blue eyes.
Q: In the game of BizzBuzz, players generally sit in a circle. The player designated to go first says…
A:
Q: Engineering P4.4.1.9 A mass m is attached to the end of a rope of length r= 3 meters. The rope can…
A: Required: A mass m is attached to the end of a rope of length r = 3 meters. The rope can only be…
Q: The income tax that employees need to pay are as below: For salary greater than or equal to 10000…
A: Here is the python code: See below steps.
Q: A programmer wants to determine whether a score is within 10 points of a given target. For example,…
A: Answer is option D (target-10 ≤ score) AND (score ≤ target +10 )
Q: Exercise 7 Develop an interactive program that reads a dollar amount as an integer and then…
A: The following program illustrates an interactive program to read dollars and display its…
Q: write a program that enters the test score and display excellent, very good, good, fair. poor, or…
A: I give the code in Python along with output and code screenshot
Q: Write an algorithm and draw a flow chart , and write Code in visual basic (using IF Block…
A: Answer:
Q: What answers do you get for below queries for given program. Program : vegetarian(jose).…
A: As i have read Bartleby guidlines i can provide answer of only 1 part of questions in case of…
Q: C++ OOP A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk…
A: GIVEN: C++ OOP A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons…
Q: Exercise 1: Create a JAVA program that prompts the user to enter a numerical test mark and displays…
A: Here I have taken input from the user and then used the if-else block to first validate it. Then, I…
Q: Write a program that computes the cost of painting and installing carpet in a room. Assume that the…
A: In this question, we will create a class ROOM to store the properties of the room and to calculate…
Q: A mass m is attached to the end of a rope of length r = 3 meters. The rope can only be whirled…
A:
Q: Write Java program that asks the user to enter an integer number than accomplish each of the…
A: Java Code for the above problem program is in next step and outputs are also attached in which we…
Q: Exercise 3 Write a Java program that computes the value of z where z=x2+2y+1 where x and y are given…
A: 3. Write a Java program which takes two input numbers x and y and it should give a result value for…
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: C++ Code for the given Question #include<bits/stdc++.h>#include <iostream> using…
Q: Create a Sample Code using Java If Else Statement Problem Here's the given: If - Good Morning else…
A: I have given java code below
Q: Write a code for the following problem: “If the day of the week is Monday through Friday, then a…
A: There are several ways to implement this code structure. We can use if / Then / Else and conditional…
Q: If you are flying with an economy ticket, there is a possibility that you may get upgraded to…
A: Decision table is a method of describing the logical relationship as a visual representation ( in…
Q: Exercise 2 Modify the program that computes wall area to allow the user to enter the price of a…
A: The Pseudo code represents the sequence of logical steps in English-like language. The p code…
Q: Assuming the following code, what will the value of x be after the code is executed: x = 20 if x %…
A: Here initially x=20 if x % 2 == 0: As x is divisible by 2, x%2 = 20%2 return 0, thus this…
Q: Write a program that recommends the number of calories a person should eat each day. Calories are…
A: Program to find the calories required for a person in a day. Recommend the required calories based…
Q: program used is C++ (Apartment problem) A real estate office handles, say, 50 apartment units. When…
A: For calculations - income=units*rent maintenance=units *maintenance cost profit=income-maintenence…
Q: Task: Write the full program that has the following main function. Your program should ask the user…
A: Given: Program to find area or perimeter of the rectangle.
Q: A company want to raise the salary of its employee. The raise rate is given as following: • The…
A: THIS IS A MULTIPLE QUESTION BASED PROBLEM. ONLY FIRST QUESTION IS ANSWERED. KINDLY SEND THE…
Q: (1) Ask for the number of guests. Users will enter a negative number when guests leave and a…
A: Below is the python program and its approach: - Approach: - Declaring the variables and storing…
Q: (Apartment problem) A real estate office handles , say, 50 apartment units. When the rent is, say,…
A: PROGRAM: //Header file #include <iostream> #include<iomanip> //Using namespace using…
Q: reate a JAVA program that prompts the user to enter a numerical test mark and displays the…
A: Here I have taken input from the user and then used the if-else block to first validate it. Then, I…
Q: Change Return Program: (Write a python program for the following) The user enters a cost and then…
A: flag = 0while flag == 0 : cost = float(input("Enter the cost: ")) amount = float(input("Enter…
Q: Engineering P4.4.1.8 A mass m = 2 kilograms is attached to the end of a rope of length r = 3 meters.…
A: given: mass = 2kg length = 3 meters tension = 60 newtons
Q: Write a v program There are four types of fruits Apples, Oranges, Bananas and Grapes. Eachs…
A: Always mention in which program we should have to write program. We only give you flow chart of this…
Q: Write a program using else if to input the number of students(stu) and number of teachers(tea) in…
A: C used to answer this question
Q: 3. Write a program that checks the screen time of a child and repeats, this procedure three times.…
A: #include<stdio.h>int main(){ int age; float screen_time; for(int i=0;i<3;i++){…
Q: C++ Programming Exercise: Ther are 50 apartment units. When the rent is $600 per month, all the…
A: #include <iostream>using namespace std;#include<fstream>int main (){double rent,…
Q: A contractor orders, say, 30 cubic yards of premixed concrete toconstruct a patio that is to be,…
A: Code : #include <iostream> #include <cmath> using namespace std; int main() {…
Q: Write a program to check whether the message received at the destination is error-free. For…
A: Algorithm 1. Declare variable length1 and length2 to record length of both the sequence 2. Start…
Q: The flight of a model rocket can be modeled as follows. During the first 0.15 s the rocket is…
A: Given: Mass of the rocket: Not given, so, I have taken 0.1 Propulsion during the first 0.15s is: 16N…
Q: Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length…
A:
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: Find the required code given as below and sample output :
Q: Create a JAVA Programming using Conditional Flow Control of your choice A. 1. Using either while or…
A:
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be…
A: Please find the answer below :
Q: Create a program and inside your program, type the code as given below. Then rewrite the nested ifs…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: 2) If last digit of your id is 0,1,2,3,4 then answer (a), if last digit of your id is 5,6,7,8,9 then…
A: PROGRAM EXPLANATION: Import java.util package. Create the main class. Define a method check, this…
Q: Exercise 1 Write a Java program that computes the sum of even numbers less than or equal to n where…
A: A java program that computes the sum of even numbers less than or equal to N
Q: 2. Write a program that computes the cost of painting and installing carpet in a room. Assume that…
A: Actually, program is a executable software that runs on a computer.
Q: Write a program that reads the temperature and unit from the user and prints a message indicating if…
A: In C Programming, When an if else statement is present inside the body of another “if” or “else”…
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: Given The answer is given below.
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 3 steps with 1 images
- 1-Convert the code below to OOP (Class) 2-give a detail explanation of the code #include <iostream> #include <cmath> #define boardSize 15 #define boardWidth 50 // put into grid the count no of # from x,y void putBlock(char grid[boardSize][boardWidth], int x, int y, int count) { for (int i = 0; i < count; i++) grid[x][y + i] = '#'; } // put into grid the count no of space from x,y void putSpace(char grid[boardSize][boardWidth], int x, int y, int count) { for (int i = 0; i < count; i++) if (grid[x][y + i] != '#') grid[x][y + i] = ' '; } void putCircle(char grid[boardSize][boardWidth], int x, int y) { // line 1 putSpace(grid, x, y, 3); putBlock(grid, x, y + 3, 5); // line 2 putSpace(grid, x + 1, y, 1); putBlock(grid, x + 1, y + 1, 2); putSpace(grid, x + 1, y + 3, 5); putBlock(grid, x + 1, y + 8, 2); // line 3 putBlock(grid, x + 2, y, 1); putSpace(grid, x + 2, y + 1, 9);…JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National Heart, Lung, and Blood Institute of the National Institutes of Health, body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. It is used to monitor one's health by determining whether one is underweight, overweight, has normal weight or is obese. It is computed based as follows (when using standard weight in pounds and height in inches): BMI = 703 x (weight/(height2)) Furthermore, people with BMI scores that are less than 18.5 are said to be underweight. Those with scores between 18.5–24.9 (inclusive) are of normal weight. Those with scores between 25–29.9 (inclusive) are said to be overweight. And those with scores 30 or higher are obese. Input The input is composed of two positive integers representing the weight in pounds and the height in inches. 140·65 Output A single line containing two values: the computed…Problem Description: The international standard letter/number mapping found on the telephone keypad is shown below: Write a pseudocode and program that reads a letter and displays its corresponding digit. 2 3 1 ABC DEF 4 5 6 GHI JKL MNO 7 8 9 PQRS TUV WXYZ 0 Write a pseudocode on how you would solve the problem in your own word. Write a java program called Phone considering the following directions. Practice here first then write answer on the answer sheet. Also, make sure distinguish high and low caps as Java is case – sensitive. Import and declare a Scanner class Ask user for an Upper – case letter Use the switch statement along with case and break Use the System.exit(1) in the default to terminate the program Print the corresponding digit
- In C programming language write Task 2: Hangman gameWrite a terminal based on the game of Hangman. In a hangman game, the player is given a wordthat they need to guess, with each letter of the word represented by an underscore/blank. Theplayer tries to guess a letter of the word by entering it into the terminal. If the letter is correct, theblank corresponding to that letter is filled in. If the letter is incorrect, a part of a stick figure isdrawn. The player has a limited number of incorrect guesses before the stick figure is fully drawnand the game is lost. The player wins the game if they guess all the letters of the word before thestick figure is fully drawn.The program should have an array of possible words to choose from. A different word should berandomly chosen from the array every time we run the program.Others: Do not use GOTO statementsJordan University of Science and TechnologyCS415 Contemporary Programming TechniquesMidterm Exam – Second semester 2021Name: ID: Section:Important note: your code must compile correctly and run without errors.Otherwise your code will get the grade zero.Question 1: Implement a java class called ParsingCustomerRecords that has thefollowing data members and functions:ParsingCustomerRecods- customerRecords: array of strings- result: string variable- recordsNumber: int variable-fileName: string variable+ Constructor(String filename, int recordsNumber)+ void Reader()+ void Executor()+ void showResult()+ String toString()All of the data members are private, and all of the methods are public.Constructor has two parameters which are (1) the file name in which Customers’ recordsare stored, and (2) the number of the records in the file. The constructor functionality is toassign suitable initial values to the fileName and recordsNumber data members. Theconstructor also should instantiate the…Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 9. Given the following code, the output is the date and time of __.Calendar cal = Calendar.getInstance(); TimeZone tz = TimeZone.getTimeZone("Europe/Rome");TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome" time zone.B. the time zone is computer is currently set to use.C. the "America/Los_Angeles" time zone.D. the "Asia/Istanbul" time zone.E. All of the three listed time zones. Part 2 - 10. Given the following code, the output is the date and time of __. Calendar cal = Calendar.getInstance();TimeZone tz = TimeZone.getTimeZone("Europe/Rome");cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome"…
- Transcribed Image Text JAVA Programming Problem: In the game of "Assassin's Creed", you control a ship with a cannon which is attacking a large enemy Assassin's Creed, armed with many guns. Your goal is to destroy as many of the guns as possible. The battle field is a 2D Cartesian grid, where your cannon is located at the origin. The enemy Assassin's Creed is a horizontal line segment located from the coordinates (X1, Y) to (X2, Y). There are exactly (X2 - X1 + 1) guns on the ship, located at the integer points (X1, Y), (X1+1, Y), ..., (X2, Y). However, the problem is, you cannot always fire at a gun. There are supernatural rocks located at all points of the battlefield whose X and Y coordinates are both integers. In order to fire successfully at an enemy's gun, the line connecting your cannon and that gun must not go through any rocks. Develop a JAVA code to output the number of the enemy battleship's guns that your cannon can destroy. Test Case Result 1 2 2 -226. IN PYTHON A shop needs to be stocked with items that can be purchased. This component isused to create different types of items that the shop stocks. It is also used toincrement the number of each item that it has in stock. Items may have expirationdates that are set when they are created, so this system will remove expired itemsfrom stock when requested to do so.• In this component a user is presented with an items main home screen withoptions/buttons to allow users to: “add items” and “view all items”.• The “add items” screen will take the following input: item name, item type(dropdown with the following options: luxury, essential, gift) and expirationdate. All fields are mandatory. An add button will add the item to a list. Whenan item is added it gets a unique id and the number of items (quantity) of thisitem type are incremented. A return button/option (if no GUI) will bring theuser back to the items main home screen.• The “view items” screen will display all items in stock…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…
- PLEASE CODE IN PYTHON The Penny Pitch game is popular in amusement parks. Pennies are tossed onto a board that has certain areas marked with different prizes. For example: The prizes available on this board are puzzle, game, ball, poster, and doll. At the end of the game, if all of the squares that say BALL are covered by a penny, the player gets the ball. This is also true for the other prizes. The board is made up of 25 squares (5 x 5). Each prize appears on three randomly chosen squares so that 15 squares contain prizes.In Python, create a PennyPitch application that displays a Penny Pitch board (use [ and ] to indicate squares) with prizes randomly placed and then simulates ten pennies being randomly pitched onto the board. After the pennies have been pitched, the application should display a message indicating which prizes have been won, if any.nstructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter the amount of your check >> 12.99 Enter the amount of your friend's check >> 9.50 The tip should be at least $1.9485 The tip should be at least $1.425 Task 1: The DebugThree1 class compiles without error. Task 2: The calcTip() method calculates a 15% gratuity. Task 3: The DebugThree1 program accepts user input and displays the correct output.Look at this program: int main(){ int x = 4; displayMessage(); return 0;}void displayMessage(){ for(int x = 1; x <= 100; x++) cout << "I love computer science" << endl;} What will the output be? Answers: Nothing. It won't compile because you can't define the variable x inside a loop heading. Nothing. It won't compile because the displayMessage function is being called before it has been defined "I love computer science" 100 times "I love computer science" Nothing. It won't compile because you can't call a void metho