In: Computer Science
This assignment is For a C++ class , I am having difficulty with getting the boolean statements the most; getting them set up properly inside the int main() area.
You have been asked to define a tip-calculating function named calcTip that could be integrated into a larger piece of software designed to improve guest service at a restaurant. As a result, you must conform to the function specification used throughout the rest of the project's code:
double calcTip(double checkAmount, bool postTax, bool round);
This function, when called, calculates and returns a tip amount
in U.S. dollars determined by the values of its two boolean
parameters. Any extra comments with guidance will be very
apprectiated, thank you so much!
----
tipCalc's parameters:
checkAmount:
The amount of a check in U.S. dollars with tax included.
Ex. a value of 15.00 represents $15.00 USD.
postTax:
The value of the postTax parameter determines whether the function calculates a tip before or after the tax has been added to a check amount.
A value of true means that the calculated tip will be based off the entire check amount.
A value of false indicates that tax must be removed from the check amount before a tip is calculated.
round:
The value of the round parameter determines whether or not the tip amount is rounded up before being returned. A value of true indicates that the value will be rounded up.
----
Assume that the tax rate for meals is a fixed
7.8% regardless of the geographical region in
which
this software may be used. Also, in the interest of elevating the
standard of what constitutes a
good tip, the tip rate is a fixed
20%.
As examples, a tip calculated for an entire $20.00 check (which includes tax) without rounding would be $4.00. A tip calculated for only the pre-tax amount of a $20.00 check without rounding would be $3.69.
Implementation
You must not make any changes to the calcTip's
return type or parameters.
----
In main, you must prompt for and accept user input that will be
used as arguments for a calcTip function call.
You have the freedom to structure main as you see fit, provided that I can execute your program and specify the following before a call to calcTip is made:
1.) the amount of the check after tax has been
applied (e.g. I can enter $20.00 or similar)
2.) whether or not I want my tip to be calculated off the full
check (i.e. including tax)
3.) whether or not I want to round up my tip to the nearest U.S.
dollar
You must not prompt for this input inside calcTip().
----
Once this is done, a function call to calcTip must be made inside
main; its return value
will be output.
Results
Output the following text in main after making the call to calcTip:
Your tip amount is $[TIP AMOUNT]
In order to verify program correctness, you should run the program four times under the following conditions:
1.) The user wants a 20% tip on a $15 check
before tax with no rounding.
2.) The user wants a 20% tip on a $15 check after
tax with no rounding.
3.) The user wants a 20% tip on a $15 check before
tax with rounding.
4.) The user wants a 20% tip on a $15 check after
tax with rounding.
In: Computer Science
Java Beginner
a)Create a class named Student that has fields for an ID number, number of credit hours earned, and number of points earned. (For example, many schools compute grade point averages based on a scale of 4, so a three-credit-hour class in which a student earns an A is worth 12 points.) Include methods to assign values to all fields. A Student also has a field for grade point average. Include a method to compute the grade point average field by dividing points by credit hours earned. Write methods to display the values in each Student field. Save this class as Student.java.
b)Write a class named ShowStudent that instantiates a Student object from the class you created and assign values to its fields. Compute the Student grade point average, and then display all the values associated with the Student. Save the application as ShowStudent.java.
c)Create a constructor for the Student class you created. The constructor should initialize each Student’s ID number to 9999, his or her points earned to 12, and credit hours to 3 (resulting in a grade point average of 4.0).Write a program that demonstrates that the constructor works by instantiating an object and displaying the initial values. Save the application as ShowStudent2.java.
In: Computer Science
Suggest possible security strategies needed to support encryption and network access control.
In: Computer Science
Represent the following numbers in binary 8-bit representation using singed magnitude, one's complement, two's complement, and excess-127 representations:
a) 48
b) -35
In: Computer Science
In: Computer Science
I am using NetBeans IDE Java to code and I am seeking comment to the code as well (for better understanding).
Write a program that reads in 16 values from the keyboard, displays them in a 4 x 4 array, and tests whether they form a magic square.
Example:
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
You need to test two features:
Hint: use a two-dimentional array.
public void turnLeft()
public void turnRight()
public void move()
public Point getLocation()
public String getDirection()
The turnLeft and turnRight methods change the direction but not the location. The move method moves the robot by one unit in the direction it is facing. The getDirection method returns a string "N", "E", "S", or "W".
In: Computer Science
Use the Galton dataset from the mosaicData package in R STUDIO
library(mosaic)
Create a scatter plot to show the relationship between height against father’s height (x=father, y=height)
What relationship did you see? (Use comments to write in your R Markdown file)
Separate your plot into facets by sex
Add a regression line using the “lm” method to both of your facets
Generate a box plot of height by sex.
Use the RailTrail data from the mosaicData package
library(mosaic)
Generate a scatter plot to show the relationship between the number of crossings per day volume against the high temperature that day
Separate your plot to facets by weekday
In: Computer Science
How does Microsoft use product design and production engineering play in the reduction of the impact of technology waste on the environment
In: Computer Science
C++
Description: You will write a program that reads students names followed by their final grade. It will output the names and their grade, followed by the corresponding letter grade. It will also print the name of the students(s) with the highest grade
In: Computer Science
In: Computer Science
1. Write Python program that use a while loop to determine how long it takes for an investment to double at a given interest rate.
The input will be an annualized interest rate, and the output is the number of years it takes an investment to double.
Note: The amount of initial investment can be any positive value, you can use $1.
2. Write a function def DoubleInvest(initialInvest) to perform the same functionalities as question1. Make sure to include you main function for testing.
In: Computer Science
Write pseudocode algorithms for the programs described as follows:- Available Credits A program that calculates a customer’s available credit should as the user for the following: The customers maximum amount of credit The amount of credit used by the customer Once these items have been entered, the program should calculate and display the customer’s available credit. You can calculate available credit by subtracting the amount of the credit used from the maximum amount of credit. (I need this in JAVA format please)
In: Computer Science
Using C# Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Sample run 1:
You entered: 95, 80, 100, 70
Highest grade:100
Lowest grade: 70
Average grade:86.25
In: Computer Science
Terrain navigation is a key component in the design of unmanned aerial vehicles (UAVs). Vehichles such as a robot or a car, can travel on land; and vehiches such as a drone or a plane can fly above the land. A UAV system contains an on board computer that has stored the terrain information for the area in which it is to be operated, Because it knows where it is at all times (often using a global positioning system (GPS) receiver), the vehicle can then select the best path to get to a designed spot. If the destination changes, the vehicle can refer to its internal maps and recompute the new path. The computer software that guides these vechicles must be tested over a variety of land formations and topologies. Elevvation information for large grids of land is available in computer databases. One way of measuring the "difficulty" of a lanad grid with respect to terrain navigation is to determine the number of peaks in the grid, where a peak is a point that has lower elevations all around it. For this problem, we want to determine whether the value in grid position [m] [n] is peak. Assume that the values in the four positions shown are adjacent to grid position [m] [n]
| grid [m-1] [n] | ||
|---|---|---|
| grid [m][n-1] | grid [m][n] | grid [m][n+1] |
| grid [m+1] [n] |
Write a program in C PROGRAMMING that reads elevation data from a data file named grid1. txt. (this file you have to create and name it as grid 1.txt.) data as shown below which represent elevation for a grid that has 6 points along the side and seven points along the top ( the peaks have been highlighted and underlined):
5039 5127 5238 5259 5248 5310 5299
5150 5392 5410 5401 5352 5820 5321
5290 5560 5490 5421 5530 5831 5210
5110 5429 5430 5411 5459 5630 5319
4920 5129 4921 5821 4722 4921 5129
5023 5129 4822 4872 4794 4862 4245
Then prints the number of peaks and their locations. Assume that the first line of the data file contains the number of rows and the number of columns for the grid of information. These values are then followed by the elevation values, in row order. The maximum size of the grid is 25 rows by 25 columns.
Hints:
#Need solution c/c++ programmme
In: Computer Science