Objects.bxt x 3.50 0.09 3.38 0.04 26.52 0.23 2571.35 1.75 96.95 0.09 An object will float if its density is less than or equal to the density of oil, 0.00088kg/cm 3. Format and display the output on the screen as shown in the sample below. Program should include the following functions: Print (): prints the output as shown in the sample output. Den (): receives mass an volume and returns density. Sample Output: O. C:\Windows\system32\cmd.exe Volume Mass Density Float 33.50 3.38 e.09 0.00269 No 0.04 0.01183 No 26.52 2571.35 0.23 1.75 0.00867 No 0.00068 Yes e.00093 Press any key to continue . 96.95 e.09 No
Q: Given an airplane’s acceleration a and take-offspeed v, you can compute the minimum runway length…
A: Program code: //Importing utility for inputimport java.util.Scanner;//define a class…
Q: (Convert Celsius to Fahrenheit) Write a program that reads a Celsius degree from the console and…
A: The Answer is in below Steps
Q: Implement the following functions using c language. The functions return a real number: (a)…
A: PROGRAM CODE: #include <stdio.h>//convert to celsiusfloat celsius(int farh){return…
Q: The following program loads and displays an image. Complete the draw_border function to draw a black…
A: Actually, python is a easiest programming language. It is a concise(less) code. It is a dynamically…
Q: Create a program that will ask the user to input a number and then determine if the number is an odd…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Rock, paper scissor games. Use a random function for generating the random output by the computer…
A: Solution: Given, Use a random function for generating the random output by the computer side. The…
Q: This program is meant to help you get practice with writing programs to perform more complex…
A: #calculates the dotproduct of two vectorsdef dotproduct(v1,v2): sum = 0; for i,j in zip(v1,v2):…
Q: Problem #3: Write a program that reads the width, height and a character from the user, then…
A: As there is no programming language is mentioned we are writing this program in c++ Code…
Q: After all loan information is input, the program should output the loans in the following format:…
A: Note: Programming language is not mentioned so I am doing in C++ In this question, we are asked to…
Q: 1. Write a program that prompts the user to enter two points (x1, yl) and (x2, y2) and displays…
A: Here I have taken input from the user and then stored it into 4 different variables. Next, I have…
Q: while True: length width = int(input("Enter the length of a rectangle: ")) int(input("Enter the…
A: user first inputs 7 that is, when user is asked to enter the length of a rectangle, user enters 7.…
Q: Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham…
A: Code Screenshot :
Q: Write a program that asks the user to enter a float number and evaluate the function f(x) as…
A: x=float(input("Enter value of x :")) if(x<=0): f_x=-1*x elif(x<1 and x>0): f_x=x*x else:…
Q: function area = calculateArea (x, y) % Function to calculate an area given two lengths (x, y) area =…
A: **I am using an online simulator, but the answer will be the same as Matlab compiler. octave:1>…
Q: 1. Write a program that will allow a student to calculate his/her test average of four test scores.…
A: // As per our guidelines we are supposed to answer only one question. Kindly repost other questions…
Q: using python Filename for submission: bottles.py In many jurisdictions a small deposit is added to…
A: Solution: Python code: #taking input the number of container having less_1 literless_1 =…
Q: Write a program to generate a random number between 1 - 100, and then display which quartile the…
A: Program Instructions:Use the header files, constants, seed and random number generator given in the…
Q: f the truth value of A v B is true, then truth value of ~A^B can be O a) True if A is false O b)…
A: Answer: a
Q: (Geometry: area of a hexagon) The area of a hexagon can be computed using the following formula (s…
A: Code: // HexagonValue.cc// Program to calculate the area of a regular hexagon inscribed in a//…
Q: 1. area_of_equilateral_triangle An equilateral triangle is a triangle whose sides are all the same…
A: According to provided information: We need to create a program that will compute the area of an…
Q: Example I/O layout: Enter radius of a circle: 5.0 Area of a circle: routput the result in function…
A: C++ Program: #include <iostream>using namespace std; // Declare function areaCirc() Using…
Q: 1. Write a program that generates a square table that contains randomly generated integer values…
A: import randomdef main(): random.seed(1113) allRowSum =0 allColSum = 0 n =…
Q: Using Python to write a program that displays a square using the function DisplaySquare(n, ch). The…
A: PROGRAM CODE: def DisplaySquare(n,ch): for i in range(n): for i in range(n):…
Q: code output to the screen
A: int a = 3; if (a % 2) // if(3%2) -->if(1) --> if(true)…
Q: What is the value of x if m-4 and b=12? def mystery(m, b): y = 71 x = (y - b) / m return x…
A: Required: Output of the given python program
Q: This is my basic code, i want my program that if i input 4 it will print out * ** *** **** the code…
A: It you want to print them in separate new lines replace space character by new line character at…
Q: Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra"…
A: Given :- Assume that name and age have been declared suitably for storing names (like "Abdullah",…
Q: Consider a game with three dice, namely, A, B and C. Each die, when rolled, generates a number…
A: Below are the answers with explanation: As per our company guidelines we are supposed to answer only…
Q: Program Input/Output The table below shows sample test cases with input prompts and corresponding…
A: Given that write a python program to draw a chess board with alternate dark colors entered by the…
Q: Directions: Print the following shapes using def function. Provide the screenshot of codes and the…
A: I give the code in Python along with output and code screenshot
Q: The following program loads and displays an image. Complete the draw_lines function to draw a green…
A: You can write the draw_lines function like this way:
Q: 2. The coordinates of two two-dimensional points P 1 (x 1 ,y 1) and P 2 (x 2 ,y 2) are input through…
A: A line is passed through the points P1(x1, y1) and P2(x2, y2) then equation of that line is, y - y1x…
Q: CS = A15 * A14* A13* A12* All* Al10* A9 * A8* A7* A6 * A5
A: For the logical function. Find out chip selection memory range…
Q: Q3a) Summary Newton’s law states that the force, F, between two bodies of masses M1 and M2 is given…
A: Note: since programming language is not mentioned we are providing solution in c++. Part a)…
Q: Question 4: sequence Write a function sequence that accepts an number ( int ) and that prints a…
A: START WHILE n > 0 do steps 3 to IF n == 0 PRINT n ELIF n%2 == 0 PRINT n and n=n//2 ELSE PRITN n…
Q: Old-fashioned photographs from the nineteenth century are not quite black and white and not quite…
A: Answer: I have written a python code and as well as code screenshot.
Q: Write the loop condition and function body to complete the program below. The function should…
A: logic:- set upper =10 and lower =1 use while(1) loop generate pl1X= rand()%(upper-lower +…
Q: Select from the given options for each space such that the output of the program is 21: int x-10;…
A: Here we have 2 global variables x and y with the values 10 and 6. Next, in the main method, we have…
Q: Please do this in Python Programming and provide screenshots The output should be exact same like in…
A: Please do this in Python Programming and provide screenshots The output should be exact same like in…
Q: Create a function that outputs the result of a math expression in words. Examples wordedMath("One…
A: const calc = { zero: 0, one: 1, two: 2, 0: 'Zero', 1: 'One', 2: 'Two', plus(n1, n2) { return…
Q: Write a program to input a number x from the keyboard. If the number is larger than 0, find its…
A: #include<stdio.h> #include<math.h> int main()…
Q: Write a program that inputs two times in hh:mm:ss format, adds both times and displays the total…
A: Note: Here you asked two questions that are independent of each other. So I'm going to answer your…
Q: Transient PopulationPopulations are affected by the birth and death rate, as well as the number of…
A: Program:#include <iostream>using namespace std;double population(double P, double B, double D,…
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: Given the center and a point on the circle, you can use this formula to find the radius of the…
A: The program contains four functions named "distance", "radius", "circumference", and "area". In main…
Q: monthly paycheck for an employee. pay is calculated after taking the following deductions: a)…
A: PROGRAM: //Importing header import javax.swing.JOptionPane; //Defining class class…
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. nitially all lamps are off. 10…
A: Introduction Use an integer array to store the values where 0 represents light is OFF and 1…
Q: Given the center and a point on the circle, you can use this formula to find the radius of the…
A: ALGORITHM:- 1. Take input for the coordinates of center and the point on the circumference. 2.…
Step by step
Solved in 2 steps with 1 images
- The following functions are all intended to check whether a string representing a dna sequence contains any characters that are not 'a','c','g','t', 'A', 'C', 'G', or 'T'. At least some of these functions are wrong. Which ones are correct? A) def valid_dna1(dna): for c in dna: if c in 'acgtACGT': return True else: return False B) def valid_dna3(dna): for c in dna: flag = c in 'acgtACGT' return flag C) def valid_dna4(dna): for c in dna: if not c in 'acgtACGT': return False return True -------------------------------------------------------------------------------------------------------------------------------------------------------- valid_dna1 only valid_dna4 only None of them. valid_dna1, and valid_dna4 only/* Using JAVASCRIPT write a function that parses through the below object and displays all of their favorite food dishes as shown: */ let person3 = { pizza:["Deep Dish","South Side Thin Crust"], tacos:"Anything not from Taco bell", burgers:"Portillos Burgers", ice_cream:["Chocolate","Vanilla","Oreo"], shakes:[{ oberwise:"Chocolate", dunkin:"Vanilla", culvers:"All of them", mcDonalds:"Sham-rock-shake", cupids_candies:"Chocolate Malt" }] }MONTY HALL LAB write this code in python and use # to answers questions - You are only allowed to use the following functions/methods: print(), range(), len(), sum(), max(), min(), and .append(). It is not mandatory to useall of these functions/methods. In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a…
- Problem 1 consists of multiple parts. You should finish one part and ensure that it works before moving to the next part. You will need to refactor (rewrite parts of) your code as you move between parts. Only your final program will be graded. Part 1 The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers (you will need to look up how to do this). The program should then prompt the user with a question, such as How 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.>again." and let the student try the same question repeatedly until the student finally gets it right. A separate method should be…Each function should accept two integer parameters indicating the minimum and maximum X value to be plotted. The functions should have no return values. Create class-level constants for things we might wish to change later, e.g., a char called PLOT_CHAR that holds an “x” (per samples below), another char called FILL_CHAR that holds an unobtrusive character like ASCII 183, generated with a cast, e.g., (char)183. JAVA PLEASE THOSE ARE NOT PERIODS OR DOTS. USE (System.out.print((Char)183); for (.) Please DON'T USE Loops(while);, if, Arrays, lists, or other data structures, objects, libraries, or methods. Sideways Ploty = 20sin(.5x)+20 where -11<=x<=11 ··································x ·······································x ·······································x ···································x ···························x ·················x········x·xx···x··········x····················x ·····························x ····································x…3. The following program loads and displays an image. Complete the draw_border function to draw a black border around the image. Don’t change the size of the image - draw 5 black lines across the top and bottom and 5 black lines down the left and right sides of the image. Do not change the main function. import image def draw_border(pic):'''Returns an image with a black border around it'''pass #You can leave this or remove it#Your code here to draw a black border around the image def main():'''Controls the program'''fname = "https://runestone.academy/runestone/static/instructorguide/_static/arch.jpg"img = image.Image(fname)width = img.getWidth()height = img.getHeight()win = image.ImageWin(width, height)draw_border(img)img.draw(win) main() #Run the program
- Using C/C++ programming language, solve the following problems.typedef structure {int phoneID; char phoneName[50];int price;int ramMemory;float cpuSpeed;int gpuMemory;char userName[50];int userPhoneNo;char userCountry[50];} SmartPhoneType;1. Write a program that will read 5 mobile’s information from the user and save it in a file named“mobileInfo.txt”.2. Write a function that will print all the information of a specific smart phone. Use the prototype -void printPhoneInfo(SmartPhoneType phoneType);3. Print all the information of the phone using the function mentioned in the Question 2 which hasthe highest price. Use the prototype -void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType*highestPricePhone);Using C/C++ programming language, solve the following problems. typedef structure { int phoneID; char phoneName[50]; int price; int ramMemory; float cpuSpeed; int gpuMemory; char userName[50]; int userPhoneNo; char userCountry[50]; } SmartPhoneType; 1) Write a program that will read 5 mobile’s information from the user and save it in a file named “mobileInfo.txt”. 2. Write a function that will print all the information of a specific smart phone. Use the prototype - void printPhoneInfo(SmartPhoneType phoneType) 3. Print all the information of the phone using the function mentioned in the Question 2 which has the highest price. Use the prototype - void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType *highestPricePhone); PLZ DO PART 1,2,3 MUCH EASY WAY ABOUT FILES LIKE "FILENAME.TXT","R") AND WITHOUT STDERR.Using C/C++ programming language, solve the following problems. typedef structure { int phoneID; char phoneName[50]; int price; int ramMemory; float cpuSpeed; int gpuMemory; char userName[50]; int userPhoneNo; char userCountry[50]; } SmartPhoneType; 1) Write a program that will read 5 mobile’s information from the user and save it in a file named “mobileInfo.txt”. 2. Write a function that will print all the information of a specific smart phone. Use the prototype - void printPhoneInfo(SmartPhoneType phoneType) 3. Print all the information of the phone using the function mentioned in the Question 2 which has the highest price. Use the prototype - void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType *highestPricePhone); TRY TO DO DIFFRENT WAY
- Using C/C++ programming language, solve the following problems.typedef structure {int phoneID; char phoneName[50];int price;int ramMemory;float cpuSpeed;int gpuMemory;char userName[50];int userPhoneNo;char userCountry[50];} SmartPhoneType; 1) Write a program that will read 5 mobile’s information from the user and save it in a file named“mobileInfo.txt”. 2. Write a function that will print all the information of a specific smart phone. Use the prototype - void printPhoneInfo(SmartPhoneType phoneType) 3. Print all the information of the phone using the function mentioned in the Question 2 which hasthe highest price. Use the prototype -void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType*highestPricePhone); 4. Write a function that will find all the devices from a specific country and print the information using the function mentioned in the Question 2. Use the prototype - void countryWisePhone( SmartPhoneType mobileList[], int size, char *country); 5. write a…Python question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. Develop function fingerprint() that takes text (as a string) as input and creates andreturns the text “fingerprint” obtained as follows: replace each word in the text by itslength (i.e., the number of letters) and concatenate these numbers.>>> fingerprint('This is a secret message')'42167'>>> fingerprint('This message has a different fingerprint')'4731911'>>> fingerprint('Very Short')'45'8.In this exercise you will create a program that will be used in a digital library to format and sort journal entries based on the authors last name. Each entry has room to store only the last name of the author. Begin by removing the first name "Isaac" from the string variable journal_entry_1 by using the string function erase. Do not forget to also remove the whitespace so that the string variable journal_entry_1 will then contain the string "Newton" with no whitespaces. The journal entries should be sorted alphabetically based on the authors last name. For example, the last name "Brown" should come before the last name "Davis" Create an if statement so that if the last name contained within journal_entry_2 is alphabetically less than the last name contained within journal_entry_1, then the string values are swapped using the string function swap. You may use either of the comparison operators < > in the if statement but remember that following ASCII, "A" is lexicographically…