Write a java code that takes 2 parameters input and output and and guesses value of 3 variables x,y,z for following equation:
output/input = (x)/(y*z)
and range of x = 2 to 512
and y and z = 2 to 32
for example public int method(int input, int
output)
and input was 10 and output was 80
it'll return x=32 and y=2 and z=2.
In: Computer Science
WEEK 12 ASSIGNMENT:
1: Define project control
2: List and briefly describe the various project control techniques
3: Explain cost control and schedule indexes
4: Define project closure
5: Describe what is involved in project handover
In: Computer Science
Write a MATLAB program to simulate the FIFTY dice game that can automatically play the FIFTY dice game for any amount of players, keep scores for all the players, clearly show the game progress for every round, every player, and every roll in the command window, automatically ends the game when the first player accumulates 50 points or more game score, and automatically select the game winner and the winning game score.
i have coded most of the game, i need help with " any amount of players" how can i make the game work for as many players as user wants.
clc
clear
x1 = randi ([ 1,6],1);
x2 = randi ([ 1,6],1);
vec = [x1,x2];
s = sort (vec);
score =0;
round =1;
fprintf ('\tHello and welcome to your dice game!\n')
fprintf ('\tLets play, roll your dice !\n')
fprintf ('\tYou can choose as many players as you want!')
fprintf ('\t------------------------------------\n\n\n')
fprintf ('If you roll double 6, you get 25 points.\n')
fprintf ('If you roll a double 3 you go back to 0 points.\n')
fprintf ('Any other double other than 3, or 6, will get you 5 points.\n' )
fprintf ('The first to get to 50 points wins.\n')
%input = numOfPlayers ('enter how many players');
disp('Your dice numbers are: ')
disp (s)
fprintf ('This is the: %.f round \n and the score is: %.f \n First roll was: %.f\n and seccond roll was: %.f' ,round ,score ,x1 ,x2)
while score ~= 50;
if s(1) == 3 && s(2) == s(1) ;
disp (' youre score has gone back to 0')
score = 0;
elseif s(1) == 6 && s(2) == s(1)
disp ('You just got 25 points')
score= (score+25);
elseif s(1) == s(2);
disp ('You get 5 points !')
score = (score +5);
elseif score > 50
disp ('game is over you won your score is: %.f ! ',score)
else disp (' You did not get points, play again !')
end
if score ~= 50
x1 = randi ([ 1,6],1);
x2 = randi ([ 1,6],1);
vec = [x1,x2];
s = sort (vec);
round = round + 1;
fprintf('This is the: %.f round \n\t and the score is: %.f \n\t First roll was: %.f\n\t and seccond roll was: %.f' ,round ,score ,x1 ,x2 ) ;
end
end
fprintf('Your score is: %.f you won !', score);
In: Computer Science
Java please. No "hard coding" please. Need to ask for the file and load the sample file information into the class.
There is a complete theory about how queues work. In this problem create a limited model to study the order in which a bunch of customers will be attended by their cashiers on a supermarket. The conditions for the experiment are:
• Each cashier spends the same amount of time with each customer (this is just an exercise, not real life).
• There will be a defined number of queues but never less than 2 and never more than 5.
• There is a variable number of customers, never less than 1 and never more than 20 and they are identified by a letter (A, B, C, …)
• The customers are distributed randomly among the different queues. • If two customers are served at the same time, we would consider that they will be ordered following the queue number they are at (first will be customer in queue 1, second customer in queue 2)
Write a program to give the order in which the customers are attended, for example:
• There are 4 queues:
• Cashier number 1 spends 3 minutes on each customer
• Cashier number 2 spends 2 minutes on each customer
• Cashier number 3 spends 4 minutes on each customer
• Cashier number 4 spends 1 minutes on each customer
• Customers are distributed as follows:
• Queue 1 (Cashier 1): Customer A, customer E, customer I
• Queue 2 (Cashier 2): B, F, J, N
• Queue 3 (Cashier 3): C, G, L
• Queue 4 (Cashier 4): D, H, M, O, P, Q
With this input the customers will have been served in the following order and timing:
D (after 1 minute)
B (after 2 minutes on queue 2)
H (after 2 minutes on queue 4)
A (after 3 minutes on queue 1)
M (after 3 minutes on queue 4)
F (after 4 minutes on queue 2)
C (after 4 minutes on queue 3)
O (after 4 minutes on queue 4)
P (after 5 minutes)
E (after 6 minutes on queue 1)
J (after 6 minutes on queue 2)
Q (after 6 minutes on queue 4)
N (after 8 minutes on queue 2)
G (after 8 minutes on queue 3)
I (after 9 minutes)
L (after 12 minutes)
The input from a data file will have the number of queues on the first line, followed by the information for each queue, first the time spent by the cashier on a customer, the number of customers on a queue and then the order of the customers separated by a space.
Output to the screen the list of served customers ordered by the time spent in the queue separated by spaces.
Must use a queue data structure.
Refer to the sample output below.
Sample File: the following information is on the queues.txt file
4
3 3 A E I
2 4 B F J N
4 3 C G L
1 6 D H M O P Q
Sample Run:
Enter file name: queues.txt
The list ordered by time spent: D B H A M F C O P E J Q N G I L
In: Computer Science
Data mining-->
Please Perform Principal Component Analysis and K-Means Clustering on the Give dataset Below. [50 Points]
Dataset Link : https://dataminingcsc6740.s3-us-west-2.amazonaws.com/datasets/homework_2.csv
10 Points for Data Preprocessing.
15 Points for PCA Algorithm along with plots and Results Explaination.
15 Points for K-Means Algorithm with plots and Results Explination.
10 Points for Comparing the results between PCA and K-Means and whats your infer- ence from your ouputs of the algorithms.
Hints:
As per the data preprocessing step convert all the variables in the
dataset into Numerical
values as the algorithms only work with Numerical values
Then Apply both algorithms one after the other then plot the output
clusters Compare the output clusters in both the steps.
In: Computer Science
Write an algorithm to describe how to convert a user input from ounces to grams, drams and pounds. Use enough detail that you have between five and ten steps. List any assumptions.
a) Assumptions
b) Steps
In: Computer Science
Write the Pseudocode for the following programming problem.
Write a program that will calculate a tip based on the meal price and a 6% tax on a meal price. The user will enter the meal price and the program will calculate tip, tax, and the total. The total is the meal price plus the tip plus the tax. Your program will then display the values of tip, tax, and total.
The tip amounts based on the mean price are as follows:
|
Meal Price Range |
Tip Percent |
|
.01 to 5.99 |
10% |
|
6 to 12.00 |
13% |
|
12.01 to 17.00 |
16% |
|
17.01 to 25.00 |
19% |
|
25.01 and more |
22% |
The Pseudocode
TYPE PSEUDOCODE HERE
The Python Code for Reference
#the main function
def main():
print 'Welcome to the tip and tax calculator program'
print #prints a blank line
mealprice = input_meal()
tip = calc_tip(mealprice)
tax = calc_tax(mealprice)
total = calc_total(mealprice, tip, tax)
print_info(mealprice, tip, tax, total)
#this function will input meal price
def input_meal():
mealprice = input('Enter the meal price $')
mealprice = float(mealprice)
return mealprice
#this function will calculate tip at 20%
def calc_tip(mealprice):
if mealprice >= .01 and mealprice <= 5.99:
tip = mealprice * .10
elif mealprice >= 6 and mealprice <=12:
tip = mealprice * .13
elif mealprice >=12.01 and mealprice <=17:
tip = mealprice * .16
elif mealprice >= 17.01 and mealprice <=25:
tip = mealprice * .19
else:
tip = mealprice * .22
return tip
#this function will calculate tax at 6%
def calc_tax(mealprice):
tax = mealprice * .06
return tax
#this function will calculate tip, tax, and the total cost
def calc_total(mealprice, tip, tax):
total = mealprice + tip + tax
return total
#this function will print tip, tax, the mealprice, and the total
def print_info(mealprice, tip, tax, total):
print 'The meal price is $', mealprice
print 'The tip is $', tip
print 'The tax is $', tax
print 'The total is $', total
#calls main
main()
In: Computer Science
Using information from the Internet or a textbook, list four software algorithms and briefly what they do. Include your sources in the form of hyperlinks or book citations.
|
# |
Algorithm |
Source |
|
1 |
||
|
2 |
||
|
3 |
||
|
4 |
In: Computer Science
Task 3: Research Ways to Prevent Social Engineering Does your company or school have procedures in place to help to prevent social engineering? If so, what are some of those procedures? Use the Internet to research procedures that other organizations use to prevent social engineers from gaining access to confidential information. List yo
In: Computer Science
The language is C++.
1. (4 pts) What is a constructor? Explain.
2. (3 pts) What is a class? Explain.
3. (3 pts) In your own words, what is a function overloading?
In: Computer Science
In: Computer Science
(In C++)
Task 1:
Implement a code example of Constructor Chaining / Constructor Overloading.
Make sure to label class and methods with clear descriptions describing what is taking place with the source code.
Attach a snipping photo of source code and output
In: Computer Science
convert -97 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127.
Please be careful and explain all the steps and details.
In: Computer Science