Java Please
Source Only
Program 3: Distance calc. This question is fairly straightforward. Design (pseudocode) and implement (source code) a program to compute the distance between 2 points. The program prompts the user to enter 2 points (X1, Y1) and (X2, Y2). The distance between 2 points formula is: Square_Root [(X2 – X1)^2 + (Y2 – Y1)^2] Document your code, properly label the input prompts, and organize the outputs as shown in the following sample runs.
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
a. Write a function sumDigits that takes a positive
integer value and returns the
total sum of the digits in the integers from 1 to that number
inclusive.
b. Write a program to input an integer n and call the above
function in part a if n
is positive, else give ‘Value must be Positive’ message.
Sample Runs:
Enter a positive integer: 1000000
The sum of the digits in the number from 1 to 1000000 is
27000001
Enter a positive integer: -642
Value must be Positive
and write e a docstring comment for this
In: Computer Science
A pair of bevel gears has the velocity ratio equal to
(1.5). The driven gear
has 20 teeth of (15.71) circular pitch and runs at 600 r.p.m.
Calculate accurately
all dimensions and make working drawing showing the gears engaged.
The shaft
diameters of driver and driven gears are 30 mm and 25 mm
respectively.
Additionally, make the hub diameter equal to (1.7) from the shaft
diameter.
Backing for driver and driven are 28 mm and 22 mm respectively
In: Mechanical Engineering
Problem Description: Game: Bean Machine or Galton Box
To figure out if the ball falls to Left or Right, you can generate a random number using Math.random(). If this random number is greater than or equal to 0.5 we assume the ball falls to the Right otherwise it falls to the Left (or vise versa).
If there are 8 slots, the ball should hit 7 nails (8 -1), thus you should run a loop 7 times to figure out the path for that ball. If you have N balls, this whole process should be repeated N times. Here is a basic algorithm.
# of balls = N
# of slots = K
array of K elements
for ( i = 0 to N) {
int R = 0;
for (j = 0 to K-1) {
if ( random number >= 0.5)
R++;
}//end loop j
array[R] ++;
}// end loop i
Output the array to show how many balls are in each slot.
Things to DO!!!!!
Analysis: (3 points)
(Describe the problem including inputs and outputs in your own words.)
Design: (3 points)
(Describe the major steps in your algorithm for solving the problem.)
Coding: Write a well documented and properly indented Java source program. Your program should have a block comment with your name and a statement of purpose at the very top. Use meaningful variable names. You must have proper labels and informative statements for all inputs and outputs. (10 points)
Testing: (Describe how you test this program, you should use your own input data to test not just the test cases given in sample runs.) (4 points)
Test your program according to following test schedule and generate output to show the number of balls in each slot.
| N | K |
| 10 | 8 |
| 50 | 10 |
| 100 | 20 |
| 500 | 30 |
What to Submit:
In: Computer Science
An enterprise has to decide between two investment projects from which the next information is known: The investment X requires an initial investment of 150 million euros, generating annual cash flow (also in million euros) of 30 the first year, 56 the second year and 150 the third one. Meanwhile, the investment “Y” also requires an initial investment of 150 million euros, but it generates annual cash flow (also in million euros) of 40 the first year, 50 the second year and 135 the third one. If the discount rate that the enterprise demand to their investments is 15%, it is request to establish, in relation to the rate of profitability, if the investments are profitable and which one of both of them is preferable.
In: Finance
What is the error of the predicted Systolic BP when Age = 39?
| Age | Systolic BP | Year | Stories | Height | Year | Germany GDP | ||
| 47 | 145 | 1990 | 54 | 770 | 1950 | 5.725433 | ||
| 65 | 162 | 1980 | 47 | 677 | 1951 | 6.256754 | ||
| 46 | 142 | 1990 | 28 | 428 | 1952 | 6.70308 | ||
| 67 | 170 | 1989 | 38 | 410 | 1953 | 7.256435 | ||
| 42 | 124 | 1966 | 29 | 371 | 1954 | 7.72644 | ||
| 67 | 158 | 1976 | 38 | 504 | 1955 | 8.570349 | ||
| 56 | 154 | 1974 | 80 | 1136 | 1956 | 9.076571 | ||
| 64 | 162 | 1991 | 52 | 695 | 1957 | 9.45931 | ||
| 56 | 150 | 1982 | 45 | 551 | 1958 | 9.665697 | ||
| 59 | 140 | 1986 | 40 | 550 | 1959 | 10.259906 | ||
| 34 | 110 | 1931 | 49 | 568 | 1960 | 10.608815 | ||
| 42 | 128 | 1979 | 33 | 504 | 1961 | 11.032132 | ||
| 48 | 130 | 1988 | 50 | 560 | 1962 | 11.384714 | ||
| 45 | 135 | 1973 | 40 | 512 | 1963 | 11.611703 | ||
| 17 | 114 | 1981 | 31 | 448 | 1964 | 12.266443 | ||
| 20 | 116 | 1983 | 40 | 538 | 1965 | 12.813883 | ||
| 19 | 124 | 1968 | 27 | 410 | 1966 | 13.016213 | ||
| 36 | 136 | 1927 | 31 | 409 | 1967 | 12.964814 | ||
| 50 | 142 | 1969 | 35 | 504 | 1968 | 13.730252 | ||
| 39 | 120 | 1988 | 57 | 777 | 1969 | 14.665157 | ||
| 21 | 120 | 1987 | 31 | 496 | 1970 | 15.392277 | ||
| 44 | 160 | 1960 | 26 | 386 | 1971 | 15.720841 | ||
| 53 | 158 | 1984 | 39 | 530 | 1972 | 16.197464 | ||
| 63 | 144 | 1976 | 25 | 360 | 1973 | 16.907173 | ||
| 29 | 130 | 1920 | 23 | 355 | 1974 | 16.97702 | ||
| 25 | 125 | 1931 | 102 | 1250 | 1975 | 16.72403 | ||
| 69 | 175 | 1989 | 72 | 802 | 1976 | 17.6721 | ||
| 1907 | 57 | 741 | 1977 | 18.195684 | ||||
| 1988 | 54 | 739 | 1978 | 18.798212 | ||||
| 1990 | 56 | 650 | 1979 | 19.640699 | ||||
| 1973 | 45 | 592 | 1980 | 19.935295 | ||||
| 1983 | 42 | 577 | 1981 | 19.903635 | ||||
| 1971 | 36 | 500 | 1982 | 19.723139 | ||||
| 1969 | 30 | 469 | 1983 | 19.985983 | ||||
| 1971 | 22 | 320 | ||||||
| 1988 | 31 | 441 | ||||||
| 1989 | 52 | 845 | ||||||
| 1973 | 29 | 435 | ||||||
| 1987 | 34 | 435 | ||||||
| 1931 | 20 | 375 | ||||||
| 1931 | 33 | 364 | ||||||
| 1924 | 18 | 340 | ||||||
| 1931 | 23 | 375 | ||||||
| 1991 | 30 | 450 | ||||||
| 1973 | 38 | 529 | ||||||
| 1976 | 31 | 412 | ||||||
| 1990 | 62 | 722 | ||||||
| 1983 | 48 | 574 | ||||||
| 1984 | 29 | 498 | ||||||
| 1986 | 40 | 493 | ||||||
| 1986 | 30 | 379 | ||||||
| 1992 | 42 | 579 | ||||||
| 1973 | 36 | 458 | ||||||
| 1988 | 33 | 454 | ||||||
| 1979 | 72 | 952 | ||||||
| 1972 | 57 | 784 | ||||||
| 1930 | 34 | 476 | ||||||
| 1978 | 46 | 453 | ||||||
| 1978 | 30 | 440 | ||||||
| 1977 | 21 | 428 | ||||||
In: Math
The Schmedley Discount Department Store has approximately 300 customers shopping in its store between 9 A.M. and 5 P.M. on Saturdays. In deciding how many cash registers to keep open each Saturday, Schmedley’s manager considers two factors: customer waiting time (and the associated waiting cost) and the service costs of employing additional checkout clerks. Checkout clerks are paid an average of $8 per hour. When only one is on duty, the waiting time per customer is about 10 minutes (or hour); when two clerks are on duty, the average checkout time is 6 minutes per person; 4 minutes when three clerks are working; and 3 minutes when four clerks are on duty. Schmedley’s management has conducted customer satisfaction surveys and has been able to estimate that the store suffers approximately $10 in lost sales and goodwill for every hour of customer time spent waiting in checkout lines.
Number of customers
Average waiting time (per customer)
Total customer waiting time
Cost per waiting hour
Total waiting cost
Checkout clerk hourly salary
Total pay of clerks for an 8-hour shift
Total expected cost
In: Finance
Researchers experimenting with cloud seeding in Arizona want a random sequence of days for their experiments. (Reference: Proceedings of the National Academy of Science, Vol. 68, pp. 649-652.) Suppose they have the following itinerary for consecutive days, where S indicates a day for cloud seeding and N indicates a day for no cloud seeding.
| S | S | S | S | N | S | N | S | S | S | S | N | N | N | N | S | S | S | N | N | S | S | S | S |
Test the sequence for randomness. Use α = 0.05.
Find the sample test statistic R, the number of runs.
Find the upper and lower critical values in Table 10 of Appendix II.
| c1 | |
| c2 |
The following data represent annual percentage returns on Vanguard Total Bond Index for a sequence of recent years. This fund represents nearly all publicly traded U.S. bonds. (Reference: Morningstar Mutual Fund Analysis.)
| 0.5 | 9.5 | -2.2 | 18.6 | 3.2 | 9.6 | 8.7 | -0.7 | 11.7 | 8.6 | 8.4 | 7.2 |
Test the sequence for randomness about the median. Use α = 0.05.
Find the sample test statistic R, the number of runs.
Find the upper and lower critical values in Table 10 of Appendix II.
| c1 | |
| c2 |
In: Statistics and Probability
Application 1
You work for an organization that is concerned about automotive technologies. Your supervisor has asked that you examine and report significant conclusions for the following attached 1991 dataset. Your data analysis and conclusions will be used to compare similar data for more recent car models.
Your data analysis must include:
1.) The mean, standard deviation, scatterplot, histogram, or bar
chart as applicable for each of the data columns: VOL, HP, MPG, SP,
WT.
2.) A paragraph that discusses your important findings.
| Variable Names: | |||||
| 1. VOL: Cubic feet of cab space | |||||
| 2. HP: Engine horsepower | |||||
| 3. MPG: Average miles per gallon | |||||
| 4. SP: Top speed (mph) | |||||
| 5. WT: Vehicle weight (100 lb) | |||||
| MAKE / MODEL | VOL | HP | MPG | SP | WT |
| GM/GeoMetroXF1 | 89 | 49 | 65.4 | 96 | 17.5 |
| GM/GeoMetro | 92 | 55 | 56 | 97 | 20 |
| GM/GeoMetroLSI | 92 | 55 | 55.9 | 97 | 20 |
| SuzukiSwift | 92 | 70 | 49 | 105 | 20 |
| DaihatsuCharade | 92 | 53 | 46.5 | 96 | 20 |
| GM/GeoSprintTurbo | 89 | 70 | 46.2 | 105 | 20 |
| GM/GeoSprint | 92 | 55 | 45.4 | 97 | 20 |
| HondaCivicCRXHF | 50 | 62 | 59.2 | 98 | 22.5 |
| HondaCivicCRXHF | 50 | 62 | 53.3 | 98 | 22.5 |
| DaihatsuCharade | 94 | 80 | 43.4 | 107 | 22.5 |
| SubaruJusty | 89 | 73 | 41.1 | 103 | 22.5 |
| HondaCivicCRX | 50 | 92 | 40.9 | 113 | 22.5 |
| HondaCivic | 99 | 92 | 40.9 | 113 | 22.5 |
| SubaruJusty | 89 | 73 | 40.4 | 103 | 22.5 |
| SubaruJusty | 89 | 66 | 39.6 | 100 | 22.5 |
| SubaruJusty4wd | 89 | 73 | 39.3 | 103 | 22.5 |
| ToyotaTercel | 91 | 78 | 38.9 | 106 | 22.5 |
| HondaCivicCRX | 50 | 92 | 38.8 | 113 | 22.5 |
| ToyotaTercel | 91 | 78 | 38.2 | 106 | 22.5 |
| FordEscort | 103 | 90 | 42.2 | 109 | 25 |
| HondaCivic | 99 | 92 | 40.9 | 110 | 25 |
| PontiacLeMans | 107 | 74 | 40.7 | 101 | 25 |
| IsuzuStylus | 101 | 95 | 40 | 111 | 25 |
| DodgeColt | 96 | 81 | 39.3 | 105 | 25 |
| GM/GeoStorm | 89 | 95 | 38.8 | 111 | 25 |
| HondaCivicCRX | 50 | 92 | 38.4 | 110 | 25 |
| HondaCivicWagon | 117 | 92 | 38.4 | 110 | 25 |
| HondaCivic | 99 | 92 | 38.4 | 110 | 25 |
| Subaru Loyale | 102 | 90 | 29.5 | 109 | 25 |
| VolksJettaDiesel | 104 | 52 | 46.9 | 90 | 27.5 |
| Mazda323Protege | 107 | 103 | 36.3 | 112 | 27.5 |
| FordEscortWagon | 114 | 84 | 36.1 | 103 | 27.5 |
| FordEscort | 101 | 84 | 36.1 | 103 | 27.5 |
| GM/GeoPrism | 97 | 102 | 35.4 | 111 | 27.5 |
| ToyotaCorolla | 113 | 102 | 35.3 | 111 | 27.5 |
| EagleSummit | 101 | 81 | 35.1 | 102 | 27.5 |
| NissanCentraCoupe | 98 | 90 | 35.1 | 106 | 27.5 |
| NissanCentraWagon | 88 | 90 | 35 | 106 | 27.5 |
| ToyotaCelica | 86 | 102 | 33.2 | 109 | 30 |
| ToyotaCelica | 86 | 102 | 32.9 | 109 | 30 |
| ToyotaCorolla | 92 | 130 | 32.3 | 120 | 30 |
| ChevroletCorsica | 113 | 95 | 32.2 | 106 | 30 |
| ChevroletBeretta | 106 | 95 | 32.2 | 106 | 30 |
| ToyotaCorolla | 92 | 102 | 32.2 | 109 | 30 |
| PontiacSunbirdConv | 88 | 95 | 32.2 | 106 | 30 |
| DodgeShadow | 102 | 93 | 31.5 | 105 | 30 |
| DodgeDaytona | 99 | 100 | 31.5 | 108 | 30 |
| EagleSpirit | 111 | 100 | 31.4 | 108 | 30 |
| FordTempo | 103 | 98 | 31.4 | 107 | 30 |
| ToyotaCelica | 86 | 130 | 31.2 | 120 | 30 |
| ToyotaCamry | 101 | 115 | 33.7 | 109 | 35 |
| ToyotaCamry | 101 | 115 | 32.6 | 109 | 35 |
| ToyotaCamry | 101 | 115 | 31.3 | 109 | 35 |
| ToyotaCamryWagon | 124 | 115 | 31.3 | 109 | 35 |
| OldsCutlassSup | 113 | 180 | 30.4 | 133 | 35 |
| OldsCutlassSup | 113 | 160 | 28.9 | 125 | 35 |
| Saab9000 | 124 | 130 | 28 | 115 | 35 |
| FordMustang | 92 | 96 | 28 | 102 | 35 |
| ToyotaCamry | 101 | 115 | 28 | 109 | 35 |
| ChryslerLebaronConv | 94 | 100 | 28 | 104 | 35 |
| DodgeDynasty | 115 | 100 | 28 | 105 | 35 |
| Volvo740 | 111 | 145 | 27.7 | 120 | 35 |
| FordThunderbird | 116 | 120 | 25.6 | 107 | 40 |
| ChevroletCaprice | 131 | 140 | 25.3 | 114 | 40 |
| LincolnContinental | 123 | 140 | 23.9 | 114 | 40 |
| ChryslerNewYorker | 121 | 150 | 23.6 | 117 | 40 |
| BuickReatta | 50 | 165 | 23.6 | 122 | 40 |
| OldsTrof/Toronado | 114 | 165 | 23.6 | 122 | 40 |
| Oldsmobile98 | 127 | 165 | 23.6 | 122 | 40 |
| PontiacBonneville | 123 | 165 | 23.6 | 122 | 40 |
| LexusLS400 | 112 | 245 | 23.5 | 148 | 40 |
| Nissan300ZX | 50 | 280 | 23.4 | 160 | 40 |
| Volvo760Wagon | 135 | 162 | 23.4 | 121 | 40 |
| Audi200QuatroWag | 132 | 162 | 23.1 | 121 | 40 |
| BuickElectraWagon | 160 | 140 | 22.9 | 110 | 45 |
| CadillacBrougham | 129 | 140 | 22.9 | 110 | 45 |
| CadillacBrougham | 129 | 175 | 19.5 | 121 | 45 |
| Mercedes500SL | 50 | 322 | 18.1 | 165 | 45 |
| Mercedes560SEL | 115 | 238 | 17.2 | 140 | 45 |
| JaguarXJSConvert | 50 | 263 | 17 | 147 | 45 |
| BMW750IL | 119 | 295 | 16.7 | 157 | 45 |
| Rolls-RoyceVarious | 107 | 236 | 13.2 | 130 | 55 |
In: Statistics and Probability