#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 = 800; time = sqrt (2 * height / 32.2); cout <<"It will take " <« time << <« height <« " feet.\n"; seconds to fall return 0;
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: The following declaration, program, and program segment has errors. Locate as many as you can.…
A:
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: Return type_________________ indicates that a function will perform a task but will not returnany…
A: Given: Return type_________________ indicates that a function will perform a task but will not…
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: members , D, s, c, and m. The program should define a four variable of type numbers and input values…
A: struct structure_name{ data-type member-1; data-type member-2; data-type member-3; data-type…
Q: Q4: Declare a data structure marks t, which contains the following type int members: int attendance…
A: Here is Your Code #include <stdio.h>#include <string.h> struct marks_t { int…
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: Write a program that calculates the damage inflicted by a weapon against a target. The user will…
A: Actually, program is an executable software that runs on a computer.
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: int vall = 7; while (vall <= 10); vall+=val1%5;
A: 1-The loop will not execute any single time. Because while loop syntax is wrong here. So, here…
Q: Lab 5B-Value Returning Functions Falling Distance When an object is falling because of gravity, the…
A: Here I have created a file named distance.py. Inside this, I have created a function named…
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: 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: 4. (Calory.java) Write a program that asks the user to enter the number of calories and fat grams in…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
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: struct ID { int x; int y; }; struct name { ID r; }; int main() { name a[2]; for (int i=0;i<2;i++) {…
A: Given code is struct ID { int x; int y; }; struct name {ID r; }; int main() { name a[2]; for(int…
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: Bulgarian solitaire def bulgarian_solitaire(piles, k): You are given a row of piles of pebbles,…
A:
Q: Hinclude Hinclude ciomanip> using namespace std; void test(int first, int& second); int main () int…
A: The output is below:
Q: #include // this line can be placed second instead of first #include // this line can be placed…
A: Approach: Import the essential header. Defining the main method. Initialize the symbolic constant…
Q: 1.8 When declaring a new variable out of an existing enumerated data type, you use the keyword: а.…
A: When declaring a new variable out of an existing enumerated data type, the keyword typedef is used.…
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: Q4: Declare a data structure marks t, which contains the following type int members: • int…
A: Required: declare a data structure marks_t which contains the given member variable: Required…
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: #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: Q1: Write a C++ class called 'Circle' with private data members: name(string type) and Radius (float…
A: I have given an answer in step 2.
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: This program calculates the total number of left-handed and right-handed //…
A: #include<iostream> using namespace std; int main(){ string leftOrRight = ""; // L or R for…
Q: onsider writing code that starts with the ima nage, resulting in the picture on the right be
A: var image=new Simpleimage("Chapel.png"); print(image);
Q: oop using c++ please give me full answer thanks Write a class Currency and makes the following…
A: #include <iostream> using namespace std; class Currency{ string Currency_name;…
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: #include #include using namespace std; int main() { char letter; cout > letter; if (letter ==…
A:
Q: // LeftOrRight.cpp - This program calculates the total number of left-handed and right-handed //…
A: #include <iostream>#include <string>using namespace std;int main(){ string…
Q: V7 This pseudocode is intended to display // employee net pay values. All employees have a standard…
A: Program plan: Declare the variable name Define the variable EOFNAME as "ZZZZ" Define DEDUCTION as…
Q: Exercise - Functions and Optionals If an app asks for a user's age, it may be because the app…
A: the code is given below :
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: Art.java must take one (1) integer command-line argument n that controls the depth of recursion.…
A: import java.awt.*;import javax.swing.*; public class DrawLines extends JPanel { static int i = 0;…
Q: Please help me solve this problem
A: Program Instructions:Create a function with two parameters a point with integer coordinates and a…
Q: C++ Coding Write a program that asks a teacher to enter the student's and the grades received on…
A: C++ Coding Write a program that asks a teacher to enter the student's and the grades received on her…
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!…
To modify the given
Step by step
Solved in 2 steps with 1 images
- C+++ HELP WITH MISSING CONSTRUCTOR Use a member initialization list to make the GamePoints' constructor assign teamPanthers with 500 and teamWolves with 500 #include <iostream>using namespace std; class GamePoints { public: GamePoints(); void Start() const; private: int teamPanthers; int teamWolves;}; GamePoints::GamePoints() :/* Your code goes here */{} void GamePoints::Start() const { cout << "Game started: Panthers " << teamPanthers << " - " << teamWolves << " Wolves" << endl;} int main() { GamePoints myGame; myGame.Start(); return 0;}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…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…
- 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.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…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…
- C++ please! Create a class called Employee that includes three data members: a firstname (type string), a last name (type string), and monthly salary (type int).The class will have a constructor that initializes the three data members.Include the set and get member functions for each data member. If the monthlysalary is not positive, the set function will set it to 0. Also include amember function that returns the yearly salary (i.e. twelve times the monthlysalary).Write a test program that prompts the user to enter the first and lastname of an employee as well as their monthly salary. The program will thenoutput the yearly salary of the employee, give them a 10 percent raise, andoutput the yearly salary again.C# (Odd or Even) Write an app that reads an integer, then determines and displays whether it’s odd or even. (Hints: use the remainder operator) (Multiples) Write an app that reads two integers, determines whether the first is a multiple of the second, and displays the result. (Hints: use the remainder operator). Create a class called Date that includes three pieces of information as auto-implemented properties: a month (type int), a day (type int), and a year (type int). Your class should have a constructor that initializes the three fields. Provide a method DisplayDate() that displays the three fields (separated by '/'). Write a test app named DateDemo that demonstrates class Date’s capabilities.PROGRAMMING LANGUAGE: C++ Write a complete C++ program with the following features.a. Declare a class Time with two fields, hour and minute.b. Provide appropriate constructors to initialize the data members.c. Overload the pre and postfix increment operators (using memberfunctions) to increment the minutes by one. Also make sure if m inutes are59 and you increment the Time it should update hours and minutesaccordingly.d. Provide a function display() to display the hours and minutes.e. In main(), create objects of Time, initialize them using constructors andcall the display functions.f. Test the following in your main:a. T3= ++T1;b. T4=T2++;
- (Physics: acceleration) Average acceleration is defined as the change of velocity divided by the time taken to make the change, as shown in the following formula: a = (v1 - v0) / t Here, v0 is the starting velocity in meters per second, v1 is the ending velocity in meters per second, and t is the time span in seconds. Assume v0 is 5.6, v1 is 10.5, and t is 0.5, and write the code to display the average acceleration. Class Name: Exercise01_02ExtraC++ Stars This lab exercise will practice creating objects with constructors and destructors and demonstrate when constructors and destructors are called. Star Class Create a class, Star. A Star object has two member variables: its name, and a solar radius. This class should have a constructor which takes a std::string, the name of the star, and a double, the solar radius of the star. In the constructor, the Star class should print to the terminal that the star was born. For example, if you create a Star as follows: Star my_star("Saiph", 22.2); Then the constructor should print: The star Saiph was born. In the destructor, the Star class should print to the terminal that the star was destroyed, along with the number of times the volume of the sun that that star was, formatted to two decimal places. Hint: use the following line to set the precision to 2 decimal places: std::cout << std::fixed << std::setprecision(2); For example, when my_star above has its destructor called,…In C++ QUESTION 14 class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Write the function definition for the function perimeter