#include // this line can be placed second instead of first #include // this line can be placed first instead of second using namespace std; int main() int height; double time; height time = sgrt (2 * height / 32.2); cout <<"It will take 800; <« time << seconds to fall <« height << " feet. \n"; return 0;
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A:
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Actually. Python is a easiest programming language. It is a dynamically typed programming language.
Q: #include using namespace std; void myfunction(int num2,int num1); int main(){ myfunction(5,2);…
A: Please find the answer below :
Q: Assignment Description This program will simulate part of the game of Yahtzee! This is a dice…
A: Python code: yahtzee.py:
Q: #include using namespace std; void myfunction(int num2, int nu int main(){ myfunction(5,2); return…
A: Function declaration is done in the third line saying myfunction accepts two integer parameters and…
Q: e T1 name; e T2 stulD; е Т3 CGPA; void setStuD:
A: Ans- public void setStuData(String n,int d,double g) System.out.println(name+" "+stuID+"…
Q: //Below is the starting code for this homework assignment// #include struct employees {…
A: To take input in the readEmployee function we use the arrow operator to take the input (->) It…
Q: *3.1 (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bæ + c = 0 can…
A: Code: import java.lang.Math;import java.util.Scanner; class Roots{public static void main(String…
Q: (Return number of digits) Write a function that returns the number of digits in an integer using the…
A: program approach returns number of digits if number is 0 return 1 else to hold count of number…
Q: Part 3– Change In this part, you are asked to write a program that makes change for amounts less…
A: Introduction:- Below is the complete solution with Python Program and Output Images.
Q: Assignment Write a program that calculates the revenue of a trip of a train composed of several…
A: Dear Student, As no programming language is mentioned so, I am coding it in c++. I will also provide…
Q: Write a program that calculates your grade in this class based on weights for each category and…
A: Algorithm Start Recieve input score from user for reading assignment and assign it to a variable(…
Q: I am using python. How would this code be written? Can someone explain the loop concept?
A: Program: #input for available candy barscandyBar=int(input("Please enter the number of candy bars…
Q: Dry run the following code. You have to complete the iterations and fill the table: #include…
A: Given question has asked to dry run the following code and to complete the iterations and fill the…
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: **3.23 (Geometry: point in a rectangle?) Write a program that prompts the user to enter a point (x,…
A: C++ Program for above : #include <iostream> using namespace std; int main() { int…
Q: Twin primes are a pair of prime numbers that differ by 2. Forexample, 3 and 5 are twin primes, 5 and…
A: Program: //include header file import java.util.Scanner; //definition of main class public class…
Q: 10) The assignment statement p = d; is legal even though p is not a Dog.
A: Please see the next step for solution
Q: What is pass-by-value? What is pass-by-reference? Show the result of the following programs:
A: In call by value, the actual value that is passed as argument is not changed after performing some…
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: *4.6 (Random point on a circle) Write a program that generates three random points on a circle…
A: Here is the java program: public class Main { public static void main(String[] args) { final…
Q: Create class Employee. • Use static variable annualTaxRate to store the annual tax rate for all…
A: These programs can be asked from control statements, array, string, oops etc. Java basic programs…
Q: 7.5 LAB: Name format Many documents use a specific format for a person's name. Write a program…
A: The error is generated because the program is given only one input and then expects the output. But…
Q: What will the following program display on the screen? #include <iostream> using namespace…
A: #include <iostream> using namespace std;class Tank{private:int gallons; public:Tank(){ gallons…
Q: #include using namespace std; int main(){ int i = 8; do { i--; cout << i--; while(i); return 0;
A: second option is correct option. prints 7531
Q: *2.25 (Financial application: payroll) Write a program that reads the following infor- mation and…
A: The complete code with output given below.
Q: #include struct employees { char name[20]; int ssn[9]; int yearBorn, salary;…
A: #include <stdio.h> struct employees { char name[20]; int ssn[9]; int yearBorn,…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: 2 class lineType | Instructions 3 { 4 public: The equation of a line in standard form is ax void…
A: Code for class LineType: #include <iostream> using namespace std; class LineType { public:…
Q: #include // this line can be placed second instead of first #include // this line can be placed…
A: Explanation: The modified C++ program to calculate the expected time taken to fall from specific…
Q: change normal body temperature to 36.5–37.5 °C #include using namespace std; int main() { float…
A: Given, Change the code so that normal body temperature is 36.5–37.5 °C
Q: Declare a data structure marks_t, which contains the following type int members: int attendance…
A: Syntax for declaring a structure is as follows: struct structureName { dataType memberVariable1;…
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Since you are asking multiple questions, we are answering first question for you. If you want…
Q: 4.23 (Financial application: payroll) Write a program that reads the following information and…
A: C code#include<stdio.h>#include<string.h> int main(){char employeeName[20]="";double…
Q: mplement a class CreditCard. A CreditCard is defined by a 16-digit number and an expiration date. A…
A: Lets see the solution.
Q: int i 0; = while (i < 10) { cout << i << endl; i=i+2; }
A: I HAVE PROVIDED SOLUTION IN STEP2
Q: // EmployeeBonus2.cpp - This program calculates an employee's yearly bonus. #include #include…
A: Note: Below is the required program in C++. Programming Approach: Declaring necessary header files.…
Q: Show what the program segment would display on the screen. int x = 2;…
A: Please find the answer below :
Q: #3include using namespace std; int main() { int n = 10; int *m &n; cout<<*m; return 0; }
A: - The question wants to know the output of the following code. - The code ::…
Q: main(){ int a=10; a++; cout<<a++;return 0;} * Linking Error О 11 Compilation Error О 10 What…
A: Firstly a=10 a++ means 10 becomes 11 and in next statement becomes a=12 but it prints 11 because of…
Q: Flx the errors of this code #include namespace std; int main { int a if a 10; < 20 cout << "a is…
A: Solution: Given Code:
Q: #include using namespace std; int main() { int a,b; cin>>a>>b; int i = a; int total = e; i++; }…
A: The fixed bug code
Q: The Barking Lot is a dog day care center. Design a flowehart or pseudocode for the following: . A…
A: Pseudo code is used to write an algorithm in normal english language without using the manual or…
Q: The Barking Lot is a dog day care center. Design a flowchart or pseudocode for the following: d.…
A: Pseudocode :- start Declaration num idNm String nme String breed num age num weigh num bil num QUIT…
Q: This program determines if an airline passenger is // eligible for a 25% discount.
A: There are two ways to find eligibility of a passenger for a 25% discount on the basis of age Using…
Q: Activity 20 Electric Bill: Using Switch Statement, write a program that will calculate and show…
A: Solution :: #include <iostream> using namespace std; int main(void){ // Your code here!…
Q: pls debug this pseudocode
A: Debug required in the following part of the code: Since, there are 4 years (1 to 4) in a school, so…
Q: a) Print the even numbers between 3 and 43. b) Print every third letter starting with 'B'. c) Print…
A: #include <iostream>using namespace std; void a() { int i; cout << "a() ->" <<…
modify the given
Step by step
Solved in 2 steps with 1 images
- Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…C CODE 3.25 Lab: Grade Calculator Write a program that calculates your grade in this class based on weights for each category and determines the letter grade. The categories and weights have been established as: Reading Assignments (10%) Lab Assignments (20%) Lab Practicums (45%) Quizzes (5%) Midterm Exam (5%) Final Exam (15%) After you calculate the course grade, use conditionals with the following ranges to determine the letter grade: A (93 - 100) A- (90 - 92.9) B+ (87 - 89.9) B (83 - 86.9) B- (80 - 82.9) C+ (77 - 79.9) C (73 - 76.9) If the grade is below 73%, display the text "You did not pass this semester." The code should interact as follows: GRADE ENTRY Enter your reading total (%): 82 Enter your lab total (%): 73 Enter your lab practicum total (%): 75 Enter your quizzes total (%): 92 Enter your midterm total (%): 86 Enter your final exam total (%): 88 RESULTS Your final course grade is: 78.65% You received a C+ for the semester. NOTE: In the grade entry section, the…Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…
- Bulgarian solitaire def bulgarian_solitaire(piles, k): You are given a row of piles of pebbles, all identical, and a positive integer k so that the total number of pebbles in these piles equals k*(k+1)//2, the arithmetic sum formula that equals the sum of positive integers from 1 to k. Almost as if intended as a metaphor for the bleak daily life behind the Iron Curtain, all pebbles are identical and you don't have any choice in your moves. Each move picks up one pebble from each pile (even if doing so makes that pile vanish), and creates a new pile from the resulting handful. For example, starting with[7, 4, 2, 1, 1], the first move turns this into [6, 3, 1, 5]. The next move turns that into [5, 2, 4, 4], which then turns into the five-pile configuration [4, 1, 3, 3, 4], and so on. This function should count how many moves are needed to convert the given initial piles into the goal state where each number from 1 to k appears as the size of exactly one pile, and return that count. These…PLEASE I NEED 4 AND 5 (iv) Construct an ogive.Question 2: Ben number (In Java)Ben had difficulty coming out with an assignment question, then he created an odd number called Ben number, which is the sum of a Ben series. Let x be the starting number and y be the bout number, in the Ben series, the x should double the value when it is an even number. In contrast, the number should be subtracted by 1 when x is an odd number. Both x and y should be greater than 0.Example of a Ben series, Assume the x = 3, and y = 5, then the series should be [3, 2, 4, 8,16]. Then the Ben number should be 33 because of 3+2+4+18+16.Thus, given the method benNumber(m,n), for all m, n > 0benNumber(2,5) should return 62 because 2+4+8+16+32 = 62benNumber(3,8) should return 257 because 3+2+4+8+16+32+64+128 = 257benNumber(1,1) should return 1Note that you can only use recursion to solve Q1 and Q2, and you cannot use any loop. You are free to add helper methods, but you are not allowed to change the method header.
- TIME CLASS (C++) - Write a time class named timeClass - Write code to demonstrate that it works - The timeclass class will be named timeClass - The class must have these 3 constructors: #1) timeClass(); #2) timeClass(int h, int m, int s); #3) timeClass (string timeIn); - The string constructor must be capable of being separated by colons or blanks time in the 24-hour format: example 23:11:07 or 9:4:9 or 11 31 27 - DO NOT use some system functions for this assignment. You must write the code. - Yes, you can convert from string to integer stoi ( string). - In addition to the constructors, you should supply a set of getters (Accessors) getH, getM getS - In addition to that, add mutators that allow the individual setting of Hours, Minutes and Seconds: setH(int), setM ( int ) setS( int ) Include this setter ( Mutator) setTime( int NumSeconds); - So if I call setTime( 7673) you would know that that is: -- hours, -- minutes and -- seconds seconds = 53 7673 % 60…// LeftOrRight.cpp - This program calculates the total number of left-handed and right-handed // students in a class. // Input: L for left-handed; R for right handed; X to quit. // Output: Prints the number of left-handed students and the number of right-handed students. #include <iostream> #include <string> using namespace std; int main() { string leftOrRight = ""; // L or R for one student. int rightTotal = 0; // Number of right-handed students. int leftTotal = 0; // Number of left-handed students. // This is the work done in the housekeeping() function cout << "Enter an L if you are left-handed, a R if you are right-handed or X to quit: "; cin >> leftOrRight; // This is the work done in the detailLoop() function // Write your loop here. // This is the work done in the endOfJob() function // Output number of left or right-handed students. cout << "Number of left-handed students:…9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…
- 9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…Reminder: This is a bare code without any class or function/method heading around the code. Just the nested loopCIS 2275 C++ Programming Part I Program 6 Trivia Game In this program, create a simple trivia game for two players. It will work like this: Starting with player 1, each player gets a turn at answering five trivia questions. There are a total of 10 questions. When a question is displayed, four possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, they earn a point. After the answers have been selected for all of the questions, the program displays the number of points earned by each player and declare the player with the highest number of points to be the winner. The players will have the option of playing another round. The flow of the program will be: 1. Show the Header information. 2. Create an array of Question structs. 3. Read the questions from the text file. 4. If the questions were properly read, start a do-while loop. 5. Declare and initialize: a. playerOnePoints and playerTwoPoints b. questionNumber…