Exercise 4: Write a program that determines the distance to a lightning strike based between the flash and the sound of thunder. The speed of sound is approximately 1. mile is 5280 ft.
Q: process from the notes} to con
A: Given Use the !{process from the notes} to construct a NFA N_5 that recognizes the @lang L(N_1)*. U...
Q: IN C++ USING CLASS Write a program in C++ that implements the game tic-tac-toe: Tic-...
A: Given The answer is given below. include<bits/stdc++.h> using namespace std; #define COMPUTER1...
Q: Flow control is one of the main building blocks that determines how a program should run. Ghana Coco...
A: Controlling the flow of information (data): Flow management is the activity of controlling the pace ...
Q: SIX If the two values are identical, write the word "MATCH" otherwise, indicate whether the "TOP" or...
A: code to compare two numbers
Q: Which one of the following is/are true ? e" +n = 0 (n³) V(n) + n = 0 (n log (n)) n* n * n +n* 2 = N ...
A: The answer is
Q: What is the time complexity of the following function- 5T(n/5+50)+n,T(1)=1 (a) θ(50logn) (b) θ(n5...
A: What is the time complexity of the following function- 5T(n/5+50)+n,T(1)=1 (a) θ(50logn) (b) θ(n...
Q: Exercise 2: Write a program that calculates the cost per square inch of a circular pizza, given its ...
A: import java.util.*;import java.text.*;public class Main { public static void main(String[] args) { ...
Q: Create a C program that can identify the memory usage using the undefined behavior statement
A: Program c : Undifened behavior:.
Q: 1. Files and folders; we all use them today on our varying computer devices. Discuss two reasons to...
A: Given The answer is given below,
Q: Script 1: create a JavaScript program that defines, as an array, a list of 10 of your favorite thing...
A: Note: I have given answered as asked in the question Solution: forEach: The name itself says each wh...
Q: What trade-offs do you have to make when building enormously scattered data environments?
A: A trade-off is characterized in economics as a "opportunity cost." For instance, you may take a day ...
Q: Write an assembly language program (simply type it in the note pad and upload here) to calculate and...
A: Question 1. Write an assembly language program (simply type it in the note pad and upload here) to c...
Q: Design a program in assembly language emu 8086 that provides the following features of the Library ...
A: Check further steps for the answer :
Q: What are the different stages of the overall structural testing procedure?
A: Given Write about different level of structural testing procedure.
Q: Examine the advantages and disadvantages of various system models.
A: Introduction: System modeling is constructing abstract models of a system, each of which gives a dif...
Q: program that prints out first 40 numbers divisible by 3
A: here in this program we will learn python code to print first 40 numbers divisible by 3. in the foll...
Q: How is the output for frequency of a DDS changed?
A: DDS (direct digital synthesis )is used for creating waveforms while digital to analog conversion.
Q: Use a fixed-point iteration method to determine a solution accurate to within 10^2 for x3 − x − 1 = ...
A:
Q: 2. What order is an algorithm that has as a growth-rate function (big -O) a. 8 x n3 – 9 xn b. 7 x lo...
A: a) f(n) = 8n^3 - 9n The above function represents a polynomial. The term with the highest degree is ...
Q: What is the definition of an inline function?
A: Introduction: An inline function is one for which the compiler instead of constructing a distinct se...
Q: The organization and connectivity of a computer's many components are referred to as its architectur...
A: The way hardware components are linked to build a computer system is referred to as computer archite...
Q: SRAM is typically used for on-chip memory because: SRAM is faster than DRAM. SRAM uses fewer transis...
A: SRAM is faster than DRAM.
Q: i = 0, j = 0 For(a = 0; a*a < n; a++){ For(b = 0; b < n; b *= 2){ For(c = 0; c*c...
A: For all intialization 1 time complexity Like i=0,j=0, c,a,n And statement inside for loop also sam...
Q: Write a Java program to find the second highest number from an user entered array of integers.
A: JAVA Program: import java.util.Scanner;public class Highest{ public static void main(String[] arg...
Q: y Queue that uses defensive design
A: given- Draw a state machine specifying the operations for a Priority Queue that uses defensive desig...
Q: 2. Please sort the input array [3 -10 9 21 -7 8 14 1] using QUICKSORT algorithm to output an increas...
A: Divide and Conquer approach is followed in the Quicksort algorithm, which helps in sorting. Subarray...
Q: What the different between java and dart in the object oriented?
A: Java is a concurrent, class-based, object-oriented, language specifically designed to have as few im...
Q: Write a Java program to find the second highest number from an user entered array of integers.
A: For this question, we will be first asking the user how many elements the user want to add to the ar...
Q: Write an SQL query to report all the classes that have at least five students. Return the result tab...
A: To create a table named Enrollment, run following code: CREATE TABLE Enrollment ( student varcha...
Q: What is the name of the size of a single storage location in the 8086 processor?
A: What is the name of the size of a single storage location in the 8086 processor?
Q: Script 1: create a JavaScript program that defines, as an array, a list of 10 of your favorite thing...
A: Screenshot of Code - Output -
Q: The following statement uses a non-correlated subquery to find the South American country with the s...
A: Question 1. The following statement uses a non-correlated subquery to find the South American countr...
Q: Create a search algorithm (I recommend a genetic algorithm) that acts as a finder of a five characte...
A: Programming language used => PYTHON I have provided PYTHON CODE along with CODE SCREENSH...
Q: a class, Team.java, that has the following: * two private instance variables: a String named color ...
A: // Java Code: import java.io.*; class Team{ //declaring the private variables private String color; ...
Q: Why are watchdog timers required in many embedded systems?
A: 1) A watchdog timer is a timer that monitors microcontroller based embedded programs to see if they ...
Q: It is vital to comprehend how multiprocessor systems interact with one another in order to classify ...
A: A multiprocessor system has many processors and a communication mechanism between processors. Homoge...
Q: It's exactly what it sounds like: a jump drive.
A: There are many devices which are used to store information. Jump drive is one of them. It is highly...
Q: In the Histogram chart, edit the bin size to be 10.0 data polnts and then close the Format Axis pane...
A: The solution is given below for the above given question:
Q: For the grammar G with the productions: S -> a S b | c | S S Give a CNF G' such that L(G') = L(G) ...
A: Solution:
Q: What faults in the Whetstone, Dhrystone, and Linpack benchmarks are addressed by the SPEC CPU benchm...
A: SPEC CPU benchmark addresses Dhrystone, Whetstone, and LINPAC benchmark deficiencies: Dhrystone is a...
Q: The organization and connectivity of a computer's many components are referred to as its architectur...
A: Your answer is here of the organization and connectivity of a computer's many components are referr...
Q: How will you find that if the first occurrence of the character 'a' in the given string is immediate...
A: Write an algorithm to find if the first occurrence of the character 'a' in the given string is immed...
Q: Q1. Give one definition for Software Quality Q2. List the parts shared by McCall's Quality Factor...
A: Given The answer is given below. Software Quality:- An effective software process applied in a manne...
Q: The organization and connectivity of a computer's many components are referred to as its architectur...
A: According to the information given: We have to define the architecture that's component referred to...
Q: Do you have any recommendations for data flow recording methods?
A: According to the information given we have to recommend data flow recording method.
Q: Write a Python Simpsons class that implements a solution to the following slightly modified problem ...
A: Python code is given below-
Q: Write a Python program that will prompt the user for an input number between 11 and 100 inclusive. C...
A: The program should not move forward until the user enters a positive integer value. Be sure to add ...
Q: Write a Matlab function named reflect_polynomial that will: [a] accept a univariate polynomial defin...
A: The objective is to write MATLAB code for the given data.
Q: (v) In JAVA, define a method that takes three integers as the parameters and returns the smallest nu...
A: In JAVA, define a method that takes three integers as the parameters and returns the smallest number...
Answer is given below-
Programming in python-
Step by step
Solved in 2 steps
- C++ OOP Write a program that prompts the capacity, in gallons, of an automobile fuel tank andthe miles per gallons the automobile can be driven. The program outputs the numberof miles the automobile can be driven without refueling.19.12 LAB: Convert from seconds People find it easier to read time in seconds, minutes, and hours rather than just seconds. Write a program that reads in seconds as input, and outputs the time in seconds, minutes, and hours. Ex: If the input is: 4000 the output is: Seconds: 40 Minutes: 6 Hours: 1 #include <iostream>using namespace std; int main() { int seconds; int minutes; int hours; /* Type your code here. */ return 0;}21.9 LAB: Speeding ticket Write a program that is given two integers representing a speed limit and driving speed in miles per hour (mph) and outputs the traffic ticket amount. Driving 10 mph under the speed limit (or slower) receives a $50 ticket. Driving 6 - 20 mph over the speed limit receives a $75 ticket. Driving 21 - 40 mph over the speed limit receives a $150 ticket. Driving faster than 40 mph over the speed limit receives a $300 ticket. Otherwise, no ticket is received.
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }PRG8: Write a program that accepts dates written in numerical form and outputs in complete form. Enter date in number form : 5 26 1986 scanf(“%d %d %d”, m,d,yy); Your date in complete form is : May 26, 1986 PRG9: Write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the use is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwhGiven the following code and output:int a[] = {10, 20, 30, 40};cout << a << endl; Example Output3F70
- 3.19 LAB: Gross Pay Write a program to prompt the user for hours and rate per hour to compute gross_pay. A sample run would look like: Enter Hours: 35 Enter Rate: 16.75 Pay: $586.25 344614.2153518.qx3zqy7 LAB ACTIVITY 3.19.1: LAB: Gross PayDriving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements. Ex: If the input is: 20.0 3.1599 the output is: 3.16 11.85 79.00Write a program that computes the molecular weight of a carbohydrate (ingrams per mole) based on the number of hydrogen, carbon, and oxygenatoms in the molecule. The program should prompt the user to enter thenumber of hydrogen atoms, the number of carbon atoms, and the numberof oxygen atoms. The program then prints the total combined molecularweight of all the atoms based on these individual atom weights:Atom Weight(grams I mole)H 1.00794c 12.01070 15.9994For example, the molecular weight of water (H20) is: 2(1.00794) +15.9994 = 18.01528.
- Activity 2 7.) Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is for home use, commercial use or industrial use. A code of H means home use, a code of c means commercial use and a code of I means industrial use. The water rates are computed as follows: code H: P250.00 plus P0.002 per gallon used code c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code I: P8,000 if usage does not exceed 4 million gallons, P14,000 if usage is more than 4 million gallons but not more than 10 million gallons and P18000 if usage exceeds 10 million gallons. Your program should prompt the user for the code and the gallons of water used. Your program should echo your input data and should print the amount due from the user. Your program should use a switch statement for the code (char data type). Use the float data type for the gallons. Sample Output in the images:6. Assume a user runs a program containing the following code segment, andenters ‘K’ at the prompt. What is the output? Const char kINDERGARTEN_CODE = ‘k’;Char gradeLevel;Cout << “Enter child’s grade level “;Cin >> gradelevel;If (gradeLevel = = KINDERGARTEN_CODE) cout << “Kindergraten Student “ << endl;else cout << “Older Student “ << e4.18 C++ Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. End with a newline. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.