Please do in Java source
Social Security Payout. If you’re taking this course, chances are that you’re going to make a pretty good salary – especially 3 to 5 years after you graduate. When you look at your paycheck, one of the taxes you pay is called Social Security. In simplest terms, it’s a way to pay into a system and receive money back when you retire (and the longer you work and the higher your salary, the higher your monthly benefit). Interestingly, your employer will pay the same amount for you. The current tax rate is 6.2% until you make approximately $132,900. For this assignment, we’re going to help out hourly employees. Design (pseudocode) and implement (source code) a program that asks users how much they make per hour, the number of hours they work per week, and calculates the yearly income. For the second half, the program should calculate and display the amount of Social Security tax the user will pay for that year. You must write and use at least two functions in addition to the main function. At least one function must not have a void return type. Note, don’t forget to put the keywords “public” and “static” in front of your functions. Document your code and properly label the input prompt and the outputs as shown below.
Sample run 1: Enter hourly wage: 10
Enter your hours per week: 40
You will earn $20800.0 per year
You will pay $1289.6 in Social Security tax
Sample run 2: Enter hourly wage: 40
Enter your hours per week: 60
You will earn $124800.0 per year
You will pay $7737.6 in Social Security tax
In: Computer Science
In the game of Lucky Sevens, the player rolls a pair of dice. If the dots add up to 7, the player wins $4; otherwise, the player loses $1. Suppose that, to entice the gullible, a casino tells players that there are many ways to win: (1, 6), (2, 5), and soon. A little mathematical analysis reveals that there are not enough ways to win to make the game worthwhile; however, because many people's eyes glaze over at the first mention of mathematics “wins $4”.
Your challenge is to write a program that demonstrates the futility of playing the game. Your Python program should take as input the amount of money that the player wants to put into the pot, and play the game until the pot is empty.
The program should have at least TWO functions (Input validation and Sum of the dots of user’s two dice). Like the program 1, your code should be user-friendly and able to handle all possible user input. The game should be able to allow a user to ply as many times as she/he wants.
The program should print a table as following:
Number of rolls Win or Loss Current value of the pot
1 Put $10
2 Win $14
3 Loss $11
4
## Loss $0
You lost your money after ## rolls of play.
The maximum amount of money in the pot during the playing is $##.
Do you want to play again?
At that point the player’s pot is empty (the Current value of the pot is zero), the program should display the number of rolls it took to break the player, as well as maximum amount of money in the pot during the playing.
Again, add good comments to your program.
Test your program with $5, $10 and $20.
In: Computer Science
Write a C++ program that reads daily weather observation data from a file and writes monthly and annual summaries of the daily data to a file.
a. The daily weather data will be contained in a file named wx_data.txt, with each line of the file representing the weather data for a single day.
b. For each day, the date, precipitation amount, maximum temperature, and minimum temperature will be provided as tab-separated data with the following format: 20180101 0.02 37 23 20180102 0.00 42 18 <...data for the remainder of the year here...>
c. For the first entry in the daily data above, the date is 20180101 (1 January 2018), the precipitation amount is 0.02 inches, the maximum temperature is 37°F, and the minimum temperature is 23°F.
d. You may assume that the weather data is complete (i.e., there is data for each day of every month of the year) and that the data contains no errors.
2. The program must read from file each daily weather observation and write a summary by month and year to a file named wx_summary.txt.
a. The output that is written to file must have the following format:
-------------------
January
-------------------
Precipitation
Total: 3.12
Average: 0.10
Temperature
Maximum: 62
Minimum: 39
-------------------
February
-------------------
Precipitation
Total: 10.18
Average: 0.36
Temperature
Maximum: 78
Minimum: 64
-------------------
March
-------------------
Precipitation
Total: 2.02
Average: 0.07
Temperature
Maximum: 73
Minimum: 53
-------------------
April
-------------------
Precipitation
Total: 3.99
Average: 0.13
Temperature
Maximum: 77
Minimum: 58
-------------------
May
-------------------
Precipitation
Total: 3.73
Average: 0.12
Temperature
Maximum: 87
Minimum: 77
-------------------
June
-------------------
Precipitation
Total: 8.47
Average: 0.28
Temperature
Maximum: 92
Minimum: 75
-------------------
July
-------------------
Precipitation
Total: 6.79
Average: 0.22
Temperature
Maximum: 89
Minimum: 74
-------------------
August
-------------------
Precipitation
Total: 7.54
Average: 0.24
Temperature
Maximum: 82
Minimum: 74
-------------------
September
-------------------
Precipitation
Total: 18.25
Average: 0.61
Temperature
Maximum: 89
Minimum: 74
-------------------
October
-------------------
Precipitation
Total: 3.75
Average: 0.12
Temperature
Maximum: 82
Minimum: 72
-------------------
November
-------------------
Precipitation
Total: 5.62
Average: 0.19
Temperature
Maximum: 77
Minimum: 63
-------------------
December
-------------------
Precipitation
Total: 16.55
Average: 0.53
Temperature
Maximum: 72
Minimum: 67
-------------------
Max temp for year: 98 in May
Min temp for year: 21 in January
Max precip for year: 18.25 in September
In: Computer Science
Explain how to use a Scanner object to read
information from a page on the internet. Give an example.
Explain what a wrapper classes are and how they are used in
Java. Give an example.
What is an ArrayList object? How does is it
similar to and how does it differ from a traditional
array.
What is inheritance? How is it useful in software projects. How
is the is-a test related to inheritance?
What is an exception? Explain how to use try/catch blocks to
prevent a program from crashing.
What is refactoring? What are some of the ways that Eclipse can
help you with refactoring?
What is the output? Explain how you obtain this answer by hand, not using a computer.
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for(int i = 1; i <= 26; i *= 2) {
System.out.print(alphabet.charAt(i - 1));
}
What is the output? Explain how you obtain this answer by hand, not using a computer.
int n = 500;
int count = 0;
while (n > 1) {
if (n % 2 == 0) {
n /= 3;
}
else {
n /= 2;
}
count++;
}
System.out.println(count);
A Java Swing application contains this paintComponent method for a panel. Sketch what is drawn by this method.
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.black);
g.fillRect(100, 100, 200, 100);
g.fillRect(300, 200, 200, 100);
g.fillRect(500, 100, 200, 100);
}
In: Computer Science
JAVA
Personal Information Class
Design a class that hold the personal data: name, address, age and phone number. Write appropriate methods (constructor, getters ad setters. Demonstrate the class by writing a program that creates three instances of the class. You can populate information in each object using Scanner class.
In: Computer Science
java - Write a method that sums all the numbers in the major diagonal in an n x n matrix of double values using the following header:
public static double sumMajorDiagonal(double [][]
m)
Write a test program that first prompts the user to enter the
dimension n of an n x n matrix, then asks them to enter the matrix
row by row (with the elements separated by spaces). The program
should then print out the sum of the major diagonal of the
matrix.
SAMPLE RUN:
Enter dimension n of nxn matrix:Enter row·0:Enter row 1:Enter·row 2:Enter row 3:17.1
(can have 3 or 4 rows)
In: Computer Science
Distinguish between tangible and intangible benefits.
In: Computer Science
Problem 3: The IsSorted class [30’]
Description:
This Java program will create an integer array object with arbitrary elements, and judge whether this array is sorted (non-decreasing). For example, array1 {2,3,1,0} is not sorted, while array2 {5, 8,10,12,15} is sorted.
You may assume the array is non-empty.
Specifications:
In addition to the main method, you need to create another method
main Method
isSorted Method
The isSorted() method takes in an array of integers as a parameter. It checks whether all elements in this array are sorted (arranged in non- decreasing order) or not, and return true or false.
Output
Your output should look something like follows:
//Suppose the array is [5, 0, 2, 3, 8]
$java IsSorted
The array is not sorted.
//Suppose the array is [1, 1]
$java IsSorted
The array is sorted.
//Suppose the array is [2, 6, 10, 15, 20]
$java IsSorted
The array is sorted.
//Suppose the array is [7, 4, 3, 0]
$java IsSorted
The array is not sorted.
In: Computer Science
In your opinion, why is it difficult to integrate IT and medicine?
In your opinion, should all HIMS implement a "integrated management" approach? (Why or Why Not?) **Tip: First, I would define what an HIMS is, Second define what an "integrated management" system is, Third: I would explain why OR why not I believed integrated management is needed in health care information systems.
In: Computer Science
In C++ and their need to be 3 files please
Instructions
In this lab, you will modify the Student class you created in a previous lab. You will modify one new data member which will be a static integer data member. Call that data member count. You also add a static method to the Student class that will display the value of count with a message indicating what the value represents, meaning I do not want to just see a value printed to the screen.
Change main so that it calls this new method towards the end of the program. Call the method using the static syntax; do not use one of the instances of the Student class.
You will also need to change the Student constructor so that it increments the new data member you added, count. In your post explain why you get the value it displays.
Download Source Lab 7 Files:
File 1.) Source.cpp
#include
#include "Student.h"
using namespace std;
int main()
{
Student rich(2);
rich.DisplayStudent();
Student mary(3);
mary.DisplayStudent();
return 0;
}
File 2.) Student.cpp
#include "Student.h"
Student::Student(int numGrades)
{
quanity = numGrades;
grades = new int[numGrades];
name = "rich";
grades[0] = 88;
grades[1] = 96;
}
Student::~Student()
{
delete[] grades;
}
void Student::DisplayStudent()
{
cout << "Grades for " << name << endl;
for (int index = 0; index < quanity; index++)
{
cout << *(grades + index) << endl;
}
}
File 3.) Student.h #pragma once
#include
#include
using namespace std;
class Student
{
public: Student(int numGrades);
~Student();
void DisplayStudent();
private: string name;
int* grades;
int quanity;
};
In: Computer Science
Java
This is background information First, code this project. Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5-cent increments (25, 30, 35, ..., 90, 95, or 100) and the machine only accepts a single dollar bill to pay for the item. For example, a possible dialogue with the user might beEnter price of item(from 25 cents to a dollar, in 5-cent increments): 45You bought an item for 45 cents and gave me a dollar,so your change is 2 quarters,0 dimes, and 1 nickel.
You can write this program based on the program or with if statements. After getting it to work, include input checking. Display the change only if a valid price is entered (no less than 25 cents, no more than 100 cents, and an integer multiple of 5 cents). Otherwise, display separate error messages for any of the following invalid inputs: a cost under 25 cents, a cost that is not an integer multiple of 5, and a cost that is more than a dollar.
Write comments
In: Computer Science
**Python**
4. Running total of product and sum of integers input by a user
Write a function ProdSum that asks a user to input a number from one to 99. If the input number is less than or equal to 25, then calculate the running product of each number inputted by the user that is less that or equal to 25. If the number is greater than 25, then calculate the running sum of each number inputted by the user that is greater that 25. If the user enters zero as input, then print out the total running product calculated and the total running sum calculated and end the function.
Assume the user can input as many numbers as desired until inputting a zero. Make sure you test the number inputted by the user to ensure it is in the range from zero to 99 and inform the user if the number is not in the range and to try again. Also print the appropriate labels for the two calculations in your print statements, as well as the number inputted by the user..
For Example:
Enter a number from 1 to 99 or 0 to Exit: 5
Enter a number from 1 to 99 or 0 to Exit: 83
Enter a number from 1 to 99 or 0 to Exit: 21
Enter a number from 1 to 99 or 0 to Exit: 55
Enter a number from 1 to 99 or 0 to Exit: 13
Enter a number from 1 to 99 or 0 to Exit: 64
Enter a number from 1 to 99 or 0 to Exit: 0
The product of the numbers [5, 21, 14] is 1470
The sum of the numbers [83, 55, 63] is 201
In: Computer Science
Please, Describe
In: Computer Science
|
Allocated block |
Free block |
|
4M |
12M |
16M |
8M |
14M |
20M |
||||||||||
|
In: Computer Science