Fill in the blanks to complete the following program: #include "splashkit.h" struct student { name; string id; int units; double grade; }; student create_student() { student temp; read_string("Please enter a name temp.id = read_integer("Please enter an id: read_integer ("How many units: temp.name = %3D temp.units read_double("What is the current grade: "); return }
Q: Project#3 (Student) Create a C# project named Proj3. In Proj3 do the following: 1. Create a class…
A:
Q: #include #include #include #include #include using namespace std; class StudentRec { private:…
A: #include<iostream>#include<iomanip>#include<string>#include<vector>#include&…
Q: Given float MyValues[ ]=(-0.4, 3.14, 99.9, 119.99); and int index=2; what will be displayed by the…
A: First we are defining array of float values with 4 items in array, and integer index variable with…
Q: Given main(), create the Calculator struct that emulates basic functions of a calculator: add,…
A: Algorithm:Define the Calculator struct with a single data member called value.Implement functions in…
Q: Given a map pre-filled with student names as keys and grades as values, complete main() by reading…
A: After completing the code, I have provided C++ CODE along with CODE SCREENSHOT and OUTPUT…
Q: int main() { int i, salary[10], range[9]={0, 0, 0, 0, 0, 0, 0, 0, 0}; double gross[10], total[10];…
A: The regular expression (RE) contains the symbol 0 and 1 only. The expression is:…
Q: JAVA Programming Problem 5 – CharacterArray Write a program which will store the following string…
A: i wll provide two solutions for this question public class CharacterArray {public static void…
Q: snack.h #include #include #include class Snack{ public: Snack(std::string, float, bool); int…
A: Algorithm:Define a Snack class with private attributes (name_, price_, expr_).Include setter methods…
Q: Appointment Class Requirements The appointment object shall have a required unique appointment ID…
A: Hey, I am writing the required code below for the above stated problem. First, I will write the code…
Q: Grade Book A teacher would like to assign a letter grade to a student, based on student's test…
A: #include<iostream>#include<string.h>#include<stdlib.h>using namespace std;string…
Q: #include #include #include class Snack{ public: Snack(std::string, float, bool); int…
A: Class Definition:Establish a class named "Snack" encapsulating private attributes such as name,…
Q: Create a module called chemistry that contains the following three functions: elementName(symbol)…
A: import math def elementName(symbol): ''' The function returns the name of the element of the…
Q: Modify the zipped code below to create your own version of the "Dice Game" which is YAHTZEE Creat…
A: Algorithm: Define a class Die with private data members value (int) and n (int). Define a default…
Q: The program should ask for the data to fill a studentRec of structure StudentRec and then ask y/n if…
A: Instruction we need to follow: The program should ask for the data to fill a studentRec of structure…
Q: Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64!! Enter another integer: 5 4…
A: Your code is incomplete. Here is the fixed code:
Q: Enter the name of Stock: Oracle Corporation Enter the symbol of Stock: URCL Enter the previous…
A: The class containing the code for the specified problem is given below: import java.lang.Math;…
Q: #include #include #include class Snack{ public: Snack(std::string, float, bool); int…
A: The following are steps needs to be taken for the required function:We ask the float value price…
Q: Programming Exercise 2-6 Instructions MileConversionsjava > Terminal 1 class MileConversions {…
A: I give the code in Java along with output and code screenshot
Q: Lab 6 Use the lab5.cpp as a started file. Modify the program is it generates 1000 points with a…
A: The Algorithm of the code is as follows:- 1. Set up an array of structs to hold 1000 points2. Set up…
Q: Write a program that declares a variable named inches , which holds a length in inches, and assign a…
A: Here, as above program is concern 1st understand about Java and their programming concept. What is…
Q: Please fix my code, my error is the bold part This is a program that inputs, processes, and…
A: Introduction: The program ask for the data to fill a studentRec of class StudentRec and then ask…
Q: Full Code: #include #include #include #define seed 5457 #define max(a,b) \ ({ __typeof__ (a) _a =…
A: Macros are a segment of code which can be given a name. These are not like variable they cannot be…
Q: Complete main() to read dates from input, one date per line. Each date's format must be as follows:…
A: Step-1: StartStep-2: Declare a vector of string as inputDatesStep-3: Start a while loop till it's…
Q: The following test score are obtained from a class with eight students: 75,24,48,65,86,45,56,94…
A: Given A[] = {75,24,48,65,86,45,56,94}
Q: String character = "Leia"; String planet = "Alderaan"; if (character.equals("Rey")) { planet =…
A: The output of the given question is given below.
Q: // DebugFive3.java // Determines whether item number on order is valid // Over 999 invalid // Less…
A: // DebugFive3.java// Determines whether item number on order is valid// Over 999 invalid// Less than…
Q: ++, a reference variable is a variable type that refers to another variable.…
A: Solution :
Q: #include #include #include "Product.h" using namespace std; int main() { vector productList;…
A: Here is what program do : Program create the empty vector which can store the object of the Product…
Q: Date Due: Wednesday, April 21, 2021 at 11:59pm Develop a program working as a soda vending machine.…
A: Since there is no language mentioned in the question. I have solved this question using c++…
Q: products := [5] string {"bread", "milk", "eggs", "butter", "sugar"} price := [5] float64{1.29,…
A: Given above are the two list, products = ["bread", "milk", "eggs", "butter", "sugar"] price =…
Q: C PROGRAMMING HELP I need help fixing an old assignment of mine. The point of the script is to…
A: Answer is given below
Q: Fix all the errors and send the code please // Application looks up home price // for different…
A: After removing error, the resulting Java codes are: import java.util.*;public class DebugEight3{…
Q: int getUpperScore(){ int upperScore = 0; for(int i = ONES; i <= SIXES; i++){…
A: The complete code:#include <iostream> using namespace std; class YahtzeeScoreboard { public:…
Q: Modify the zipped code below to create your own version of the "Dice Game" You may create any game,…
A: As you have mentioned there are modification in every program module. So as per bartleby policy we…
Q: class Artist{StringsArtist(const std::string& name="",int…
A: The objective of the question is to implement a function in the Singer class that checks if the…
Q: Program Name: _PetShelter You work at a Pet Shelter that take in homeless pets. You have been…
A: Step 1: Declare class MichakR_PetShelter with the main() method. Step 2: Declare a string array…
Q: Enter the name of Stock: Oracle Corporation Enter the symbol of Stock: URCL Enter the previous…
A: //Main.javaimport java.util.*;import java.time.*;import java.lang.Math;import java.text.*; public…
Q: class Artist{StringsArtist(const std::string& name="",int…
A: The objective of the question is to implement a function in C++ that combines two Singer objects…
Q: Consider the following code: tyepdef struct { char grade; float score; } student; void f() {…
A: memcmp() function in C structure: It is not safe to use memcmp() function in C structure. The reason…
Q: Modify the Credit Card part to check the number input based on the following condition: • American…
A: The modified javascript code has been given in step 2.
Q: Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A…
A: Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A…
Q: In C++ struct myGrades { string class; char grade; }; Declare myGrades as an array that…
A: The problem is based on the basics of structures in C++ programming language. NOTE: The name of a…
Q: get 5 unique values from the user and store them in the member variable loop to get the numbers, if…
A: using System;using System.Collections.Generic; namespace ConsoleApplication1{ class Program {…
Q: #include #include using namespace std; int main() { // Declare and initialize variables.…
A: Required: A c++ program is given, create a logic using switch statement according to instructions…
Q: #include #include #include using namespace std; int main() { constdouble MONSTERA_PRICE =11.50;…
A: Declare and initialize constants for plant prices, maximum pots, and points per dollar.Declare and…
Step by step
Solved in 2 steps
- // EmployeeBonus2.cpp - This program calculates an employee's yearly bonus. #include <iostream> #include <string> using namespace std; int main() { // Declare and initialize variables. string employeeFirstName; string employeeLastName; double employeeSalary; int employeeRating; double employeeBonus; const double BONUS_1 = .25; const double BONUS_2 = .15; const double BONUS_3 = .10; const double NO_BONUS = 0.00; const int RATING_1 = 1; const int RATING_2 = 2; const int RATING_3 = 3; // This is the work done in the housekeeping() function // Get user input cout << "Enter employee's first name: "; cin >> employeeFirstName; cout << "Enter employee's last name: "; cin >> employeeLastName; cout << "Enter employee's yearly salary: "; cin >> employeeSalary; cout << "Enter employee's performance rating: "; cin >> employeeRating; // This is…struct gameType { string title; int numPlayers; bool online; }; gameType Awesome[50]; Write the C++ statements that print out all gameType fields from Awesome whose numPlayers is > 1.Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies. Modify the application below (week3.py) so that the selection variable is sent as an argument into the choice() function. The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. You will need to add an if statement in the choice() function to make the correct selection.
- Given Triangle struct (in files Triangle.h and Triangle.c), complete main() to read and set the base and height data members of triangle1 and of triangle2, determine which triangle's area is smaller, and output that triangle's info, making use of the relevant Triangle functions. Ex: If the input is: 3.0 4.0 4.0 5.0 where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is: Triangle with smaller area: Base: 3.00 Height: 4.00 Area: 6.00 412800.2778464.gx320/7 LAB ACTIVITY 1 #include 2 #include "Triangle.h" 3 4 void setBase (Triangle *triangle, double base) { 5 triangle->base = base; 6} 7 8 void setHeight (Triangle triangle, double height) { 9 triangle->height = height; 10} 11 12 void calculateArea(Triangle *triangle) { 13 14} 9.11.1: LAB: Triangle area comparison 24 25 26 27 28 29 15 16 void printTriangle(Triangle triangle) { 17 18 19 20 } 30 31 32 21 22 main() { 23 33 34 35 36 37 38 39 40 41 triangle->area = 0.5 *…shapes = [{'type': 'circle', 'x': 300, 'y': 300, 'radius': 100, 'color': 'cyan'},{'type': 'circle', 'x': 300, 'y': 300, 'radius': 10, 'color': 'white'},{'type': 'rectangle', 'x1': 500, 'y1': 500, 'x2': 550, 'y2': 580, 'color': 'green'},{'type': 'line', 'x': 0, 'y': 0, 'a': 100, 'b': 300, 'color': "black", 'width': 7},{'type': 'point', 'x': 200, 'y': 50, 'color': 'black'},{'type': 'point', 'x': 205, 'y': 50, 'color': 'black'},{'type': 'point', 'x': 210, 'y': 50, 'color': 'black'},{'type': 'triangle', 'x': 500, 'y': 100, 'a': 600, 'b': 100, 'c': 550, 'd': 200, 'color': 'yellow'},{'type': 'oval', 'x': 100, 'y': 100, 'a': 400, 'b': 400, 'color': 'red'},{'type': 'text', 'x': 500, 'y': 50, 'message': 'hello world!', 'color': 'blue'}] I'd like to take this list and write it to a new txt file. Ignoring the ':' , {}, and words within quotation marks. so the txt file created would look like this: circle, 300,300, 100, cyancircle, 300,300, 10, whiterectangle, 500,500, 550,580, greenline, 0,0,…Assignment Name JavaScript Concepts III Assignment Filename lastname-circleArea.html (replace lastname with your last name). area.js Assignment Description This assignment demonstrates the following concepts: JavaScript Functions Assignment Instructions Write a JavaScript program that calculates the area of a circle: Write a function that calculates the area of a circle given the radius. Formula: Math.PI * (radius * radius) Your program code should contain appropriately named variables. Use documentation to identify various components of your program. Call the function once and pass a radius value of 10.75 to it. Use the starter files and complete the logic to satisfy the instructions. To access the files, download and save the circleArea.zip folder attached to this assignment. Then unzip the compressed folder to reveal the included files: circleArea.html and area.js. Be sure that the two files are in the same folder. Then write your code in the area.js…
- int main(){ long long int total; long long int init; scanf("%lld %lld", &total, &init); getchar(); long long int max = init; long long int min = init; int i; for (i = 0; i < total; i++) { char op1 = '0'; char op2 = '0'; long long int num1 = 0; long long int num2 = 0; scanf("%c %lld %c %lld", &op1, &num1, &op2, &num2); getchar(); long long int maxr = max; long long int minr = min; if (op1 == '+') { long long int sum = max + num1; maxr = sum; minr = sum; long long int res = min + num1; if (res > maxr) { max = res; } if (res < minr) { minr = res; } } else { long long int sum = max * num1; maxr = sum; minr = sum; long long int res = min * num1;…# dates and times with lubridateinstall.packages("nycflights13") library(tidyverse)library(lubridate)library(nycflights13) Qustion: Create a function called date_quarter that accepts any vector of dates as its input and then returns the corresponding quarter for each date Examples: “2019-01-01” should return “Q1” “2011-05-23” should return “Q2” “1978-09-30” should return “Q3” Etc. Use the flight's data set from the nycflights13 package to test your function by creating a new column called quarter using mutate()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…
- class Calculator: # Type your code here. if __name__ == "__main__": calc = Calculator(); num1 = float(input()) num2 = float(input()) # 1. The initial value print('{:.1f}'.format(calc.get_value())) # 2. The The value after adding num1 calc.add(num1) print('{:.1f}'.format(calc.get_value())) # 3. The value after multiplying by 3 calc.multiply(3) print('{:.1f}'.format(calc.get_value())) # 4. The value after subtracting num2 calc.subtract(num2) print('{:.1f}'.format(calc.get_value())) # 5. The value after dividing by 2 calc.divide(2) print('{:.1f}'.format(calc.get_value())) # 6. The value after calling the clear() method calc.clear() print('{:.1f}'.format(calc.get_value()))#include #include #include #define SIZE 5 int nums [SIZE] = [5,0,6,1,2); int main() { int i; pid_t pid; pid= fork(); if (pid == 0) { for (i = 0; i 0) { wait (NULL); } for (i = 0; i < SIZE; i++) printf("PARENT: %d\n", nums [i] + 1); /* LINE Y */ return 0; From the above-given program, please state what will be the output at lines X and Y. Explanation in detail required for output at both lines X and Y.Need this to be debugged // Application looks up home price// for different floor plans// allows upper or lowercase data entryimport java.util.*;public class DebugEight3{public static void main(String[] args){ Scanner input = new Scanner(System.in);String entry;char[] floorPlans = {'A','B','C','a','b','c'}int[] pricesInThousands = {145, 190, 235};char plan;int x, fp = 99;String prompt = "Please select a floor plan\n" +"Our floorPlanss are:\n" + "A - Augusta, a ranch\n" +"B - Brittany, a split level\n" +"C - Colonial, a two-story\n" +"Enter floorPlans letter";System.out.println(prompt);entry = input.next();plan = entry.charAt(1);for(x = 0; x < floorPlans.length; ++x)if(plan == floorPlans[x])x = fp;if(fp = 99)System.out.println("Invalid floor plan code entered"));else{if(fp >= 3)fp = fp - 3;System.out.println("Model " +plan + " is priced at only $" +pricesInThousends[fp] + ",000");}}}