Linux Question: you will practice on creating and editing a text file by VI.
How to:
$ sudo yum –y install java-1.8.0-openjdk-devel.x86_64
Here's the code
|
import java.util.Scanner; // Import the Scanner class class MollyHomework { public static void main(String[] args) { Scanner myObj = new Scanner(System.in); // Create a Scanner object System.out.println("Enter your first name"); String fName = myObj.nextLine(); // Read user input of the first name System.out.println("Enter your last name"); String lName = myObj.nextLine(); // Read user input of the last name System.out.println("Hello " + fName + “ “ + lName); // Output user input } } |
3.To compile the above java code, run the following command (you need to use your java file name):
$ javac MollyHomework.java
4. To execute the java program, run the following command
$ java MollyHomework
Question:
Describe how you created above file and its contents in VI.
Note: Brute-force solution means that entering characters one by one.
*Show how the code looks or how you got it to work in your linux machine
In: Computer Science
Code needed in Java
The purpose of the application is to generate some reports about
the people of the university. So a user of the application should
be able to view information about the people in the university and
generate summaries. As in implementation these are separated into
two major categories, employee and students, we will be
implementing these classes.
The system should have three classes: Person,
Employee and Student.Employees
and students are subclasses of persons and therefore, they inherit
some fields and methods from the superclass Person. What Employee
class has as an extra is a field called job which is a
String value that indicates the position of the employee at the
university. The possible values are ‘Faculty’ and ‘Staff’ and the
rest of the input should be rejected. Another significant field is
UIN (you may assume it to be an integer).Students also
have a similar structure. A field called level, gives
information regarding the student. Possible values are
‘Undergraduate’ and ‘Graduate’ and the rest of the input should be
rejected. Also A number should be implemented (you may
assume A number to be a string).
Once you create these classes write your test class with main
method.
The output of such an application would look like:
Person’s first name is Triss, last name is Merigold. She
is 25 years old.
Person’s first name is Sigismund, last name is Dijkstra. He
is 37 years old. His UIN is 793942 and serves the university as a
staff.
Person’s first name is Keira, last name is Metz. She is 19
years old. Her A-number is A021318 and she is an undergraduate
student
In: Computer Science
This should be written in C++.
Create a class with the name "Student".
private data members of the Student class should include:
int - rollno (roll number or id number of student)
string - name (name of student)
int - alg, datastruct, architect, proglang (hold scores out of 100 for these 4 classes)
float - per (average score of 4 classes above)
char - grade (letter grade based on per.. example 90 is an A)
public member functions of the Student class should include:
getdata() (function to accept data from user
showdata() (function to show data on screen
Create a constructor that initializes all int to 0, float to 0.0, char to ' ', name = "NoName".
Prompt the user for a valid class size.
Prompt the user for student data.
Store students in a vector.
Display student data including students average score and letter grade.
The following is an example:
Enter size of class: 0 Invalid class size Enter size of class: 1 Enter the roll number of student: 45 Enter The Name of student: Trish Duce Enter the grade in Algorithms out of 100: 88 Enter the grade in Data Structures out of 100: 94 Enter the grade in Architecture out of 100: 98 Enter the grade in Programming Languages out of 100: 92 Roll number of student: 45 Name of student: Trish Duce Grade in Algorithms: 88 Grade in Data Structures: 94 Grade in Architecture: 98 Grade in Programming Languages: 92 Percentage of student is: 93 Grade of student is: A
In: Computer Science
Q.1 Write a python program that will take in basic information from a student, including student name, degree name, number of credits taken so far, and the total number of credits required in the degree program. The program will then calculate how many credits are needed to graduate. Display should include the student name, the degree name, and credits left to graduate.
Write two print statements in this program. In the first one, use the .format method with pre-specified order of the displayed outputs.
In the second print, using different % operators to display the output. Make sure to display the output in an aligned format (look into a sample of the output below..).
Student name: xyz xyz
Degree name: comp. engineering
Credit taken so far: 13
Total number of credits required: 33
Number of credits needed to graduate: 20
Q.2 Write a python program that will take in the number of call minutes used. Your program will calculate the amount of charge for the first 200 minutes with a rate of $0.25; the remaining minutes with a rate of $0.35. The tax amount is calculated as 13% on top of the total. The customer could have a credit that also has to be considered in the calculation process. Finally, the program displays all these information. Below is a sample run:
Customer account number: 12345
Minutes used: (you provide)
Charge for the first 200 minutes@ 0.25: (you provide)
Charge for the remaining minutes@ 0.35: (you provide)
Taxes: (you provide)
Credits: (you provide)
Total bill: (you provide)
please provide .py program file screenshot and output.
In: Computer Science
Examine the following code, which contains six common bugs. In a separate Microsoft Word (or other word processing or text file), identify the line number of at least three (3) bugs as well as a brief description of each bug. 1. 2.
1. <!DOCTYPE html>
2. </html>
3. <head> <link rel="stylesheet" href="MyStyle.css"> </head>
4. <body>
5. <nav>
6. <a href="GroceryHome.html">Home</a> |
7. <a href="Products.html">Products</a> |
8. <a href="AboutUs.html">About Us</a> |
9. <a href="Contact.html">Contact</a>
10. </nav>
11. <header>
12. <h1> My Contact Page</h1>
13. </header>
14. <article>
15. Thank you for your interest in our grocery store. We offer delivery or call-ahead pickup services.
Please provide your contact information, and indicate your family's food preferences.
16. </article> <p>
17. <form action="#" method="post" id="form1">
18. <div class="div1">
19. <label for="fname1" >First Name:</label><br>
20. <input type="text" name="firstname1" id="fname1"><br>
21. <label for="lname1" >Last Name:</label><br>
22. <input type="text" name="lastname1" id="lname1"><br>
23. <label for="phone1" >Phone (i.e. 123-456-7890):</label><br>
24. <input type="text" name="phone1" id="phone1" placeholder="123-456-7890" ><br>
25. <label for="email1" >Email:</label><br>
26. <input type="text" name="email1" id="email1" placeholder="abc@xyz"><br>
27. <label for="contactpreference1" >Prefered contact method?</label><br>
28. <input type="radio" name="contactpreference1" value="phone" checked> Phone
29. <input type="radio" name="contactpreference1" value="email"> Email
30. <br><br>
31. <input type="submit" id="Submit1" value="Submit" onclick=" validateMyPage()" />
32. </div>
33. </form>
34. <form action="#" method="post" id="form2" >
35. <div class="div2">
36. <label for="fname2" >First Name:</label><br>
37. <input type="text" name="firstname2 id="fname2" required><br>
38. <label for="lname2" >Last Name:</label><br>
39. <input type="text" name="lastname2" id="lname2" required><br>
40. <label for="phone2" >Phone (i.e. 123-456-7890):</label><br>
41. <input type="tel" name="phone2" id="phone2" placeholder="123-456-7890" pattern='\d{3}[\-
]\d{3}[\-]\d{4}' required><br>
42. <label for="email2" >Email:</label><br>
43. <input type="email" name="email2" id="email2" placeholder="[email protected]" required><br>
44. <label for="contactpreference2" >Prefered contact method?</label><br>
45. <input type="radio" name="contactpreference2" value="phone" checked> Phone
46. <input type="radio" name="contactpreference2" value="email"> Email
47. <br><br>
48. <input type="submit" id="Submit2" value="Submit" />
49. </div>
50. <br><br>
51. <div class="myColumns ">
52. <select id="mySiteColor" onChange="changeColor(this.value)">
53. <option value="">-- Select a color --</option>
54. <option value="blue">Blue</option>
55. <option value="yellow">Yellow</option>
56. <option value="red">Red</option>
57. </select>
58. </div>
59. </form>
60. <script>
61. function validateMyPage() {
62. var firstname1 = document.getElementById("fname1").value;
63. if (firstname1 != "") {
64. alert("Please enter a first name.");
65. }
66. else {
67. alert(firstname1);
68. }
69. var phone1 = document.getElementById("phone1").value;
70. if (phone1 == "") {
71. alert("Please enter a phone number.");
72. return false;
73. }
74. else
75. {
76. var rePhone = new RegExp(/\d{3}[\-]\d{3}[\-]\d{4}/);
77. var reResult = rePhone.test(phone1);
78. if (reResult == false)
79. {
80. alert("Please provide a valid phone number in the format of: 222-222-2222.");
81. return false;
82. }
83. else
84. {
85. alert(phone1);
86. }
87. }
88. var email1 = document.getElementById("email1")!value;
89. if (email1 == "") {
90. alert("Please enter an email address.");
91. return false;
92. }
93. else
94. {
95. var reEmail = new RegExp(/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$/);
96. var reResult == reEmail.test(email1);
97. if (reResult == false)
98. {
99. alert("Please provide a valid email address.");
100. return false;
101. }
102. else
103. {
104. alert(“email1”);
105. }
106. }
107. alert("Form data validated by JavaScript successfully!");
108. }
109. function changeColor(value) {
a. var myColor = document.getElementById("mySiteColor").value;
b. document.body.style.color = value;
110. }
111. </script>
112. </body>
113. </html>
In: Computer Science
GeneralProducts Inc. is incorporated in Nevada, USA on Jan 1st 2013 to take over a local retail chain. The objective of the company is to supply goods of everyday use to customers at the most competitive prices. GeneralProducts has established a chain of stores throughout USA. The retail operations of the company are so designed that customers can shop seamlessly in stores and online.
You may use the attached Balance Sheet of GeneralProducts as of Dec 31, 2015 (Links to an external site.) and the financial data for 2016.The same information is provided below.
| Balance Sheet of GeneralProducts Inc. on December 31, 2015 | |||
|---|---|---|---|
| ASSETS | |||
| Current Assets | |||
| Cash and Cash Equivalent | 11,980 | ||
| Accounts Receivables | 20,520 | ||
| Inventory | 317,060 | ||
| Inventory of Premiums (@0.10 per premium) | 660 | ||
| Total Current Assets | 350,220 | ||
| LONG TERM ASSETS | |||
| Investments | 66,775 | ||
| Property Plant and Equipment | 750,000 | ||
| Less Accumulated Depreciation | 90,000 | 660,000 | |
| Total Long Term Assets | 726,775 | ||
| INTANGIBLE ASSETS | |||
| Trade Marks | 190,000 | ||
| Total Assets | 1,266,995 | ||
| LIABILITIES AND SHAREHOLDERS' EQUITY | |||
| Current Liabilities | |||
| Accounts Payable | 50,772 | ||
| Liability for Premiums and Coupons | 550 | ||
| 5% Short Term Notes Payable due on March 31, 2016 | 8,000 | ||
| Accrued Interest on 6% Bonds Payable | 3,000 | ||
| Total Current Liabilities | 62,272 | ||
| 6% Bonds Payable due 2020 | 100,000 | ||
| Unamortized Discount on Bonds Payable | 6,732 | 93,268 | |
| Total Liabilities | 155,540 | ||
| Stockholder's Equity | |||
| Common Stock | |||
| 125,000 shares, par value $1 authorized 100,000 shares issued and outstanding | 130,000 | ||
| Paid in Capital in Excess of Par | 946,000 | ||
| Retained Earnings | 35,455 | ||
| Total Stockholders' Equity | 1,111,455 | ||
| Total Liabilities and Stockholders' Equity | 1,266,995 | ||
GeneralProducts provides us financial and business related data for 2016 below.
Requirements
In: Accounting
Sales, Production, Direct Materials Purchases, and Direct Labor Cost Budgets
The budget director of Gourmet Grill Company requests estimates of sales, production, and other operating data from the various administrative units every month. Selected information concerning sales and production for July 2016 is summarized as follows:
a. Estimated sales for July by sales territory:
| Maine: | |
| Backyard Chef | 310 units at $700 per unit |
| Master Chef | 150 units at $1,200 per unit |
| Vermont: | |
| Backyard Chef | 240 units at $750 per unit |
| Master Chef | 110 units at $1,300 per unit |
| New Hampshire: | |
| Backyard Chef | 360 units at $750 per unit |
| Master Chef | 180 units at $1,400 per unit |
b. Estimated inventories at July 1:
| Direct materials: | |
| Grates | 290 units |
| Stainless steel | 1,500 lbs. |
| Burner subassemblies | 170 units |
| Shelves | 340 units |
| Finished products: | |
| Backyard Chef | 30 units |
| Master Chef | 32 units |
c. Desired inventories at July 31:
| Direct materials: | |
| Grates | 340 units |
| Stainless steel | 1,800 lbs. |
| Burner subassemblies | 155 units |
| Shelves | 315 units |
| Finished products: | |
| Backyard Chef | 40 units |
| Master Chef | 22 units |
d. Direct materials used in production:
| In manufacture of Backyard Chef: | |
| Grates | 3 units per unit of product |
| Stainless steel | 24 lbs. per unit of product |
| Burner subassemblies | 2 units per unit of product |
| Shelves | 4 units per unit of product |
| In manufacture of Master Chef: | |
| Grates | 6 units per unit of product |
| Stainless steel | 42 lbs. per unit of product |
| Burner subassemblies | 4 units per unit of product |
| Shelves | 5 units per unit of product |
e. Anticipated purchase price for direct materials:
| Grates | $15 per unit |
| Stainless steel | $6 per lb. |
| Burner subassemblies | 110 per unit |
| Shelves | $10 per unit |
f. Direct labor requirements:
| Backyard Chef: | |
| Stamping Department | 0.50 hr. at $17 per hr. |
| Forming Department | 0.60 hr. at $15 per hr. |
| Assembly Department | 1.0 hr. at $14 per hr. |
| Master Chef: | |
| Stamping Department | 0.60 hr. at $17 per hr. |
| Forming Department | 0.80 hr. at $15 per hr. |
| Assembly Department | 1.50 hrs. at $14 per hr. |
Required:
1. Prepare a sales budget for July.
| Gourmet Grill Company Sales Budget For the Month Ending July 31, 2016 |
||||
|---|---|---|---|---|
| Product and Area | Unit Sales Volume |
Unit Selling Price |
Total Sales | |
| Backyard Chef: | ||||
| Maine | ||||
| Vermont | ||||
| New Hampshire | ||||
| Total | ||||
| Master Chef: | ||||
| Maine | ||||
| Vermont | ||||
| New Hampshire | ||||
| Total | ||||
| Total revenue from sales | ||||
2. Prepare a production budget for July.
| Gourmet Grill Company Production Budget For the Month Ending July 31, 2016 |
||
|---|---|---|
| Units | ||
| Backyard Chef | Master Chef | |
| Expected units to be sold | ||
| Plus desired inventory, July 31, 2016 | ||
| Total | ||
| Less estimated inventory, July 1, 2016 | ||
| Total units to be produced | ||
3. Prepare a direct materials purchases budget for July.
| Gourmet Grill Company Direct Materials Purchases Budget For the Month Ending July 31, 2016 |
|||||
|---|---|---|---|---|---|
| Grates (units) |
Stainless Steel (lbs.) |
Burner Sub- assemblies (units) |
Shelves (units) |
Total | |
| Required units for production: | |||||
| Backyard Chef | |||||
| Master Chef | |||||
| Plus desired inventory, July 31, 2016 | |||||
| Total | |||||
| Less estimated inventory, July 1, 2016 | |||||
| Total units to be purchased | |||||
| Unit price | |||||
| Total direct materials to be purchased | |||||
4. Prepare a direct labor cost budget for July.
| Gourmet Grill Company Direct Labor Cost Budget For the Month Ending July 31, 2016 |
||||||||
|---|---|---|---|---|---|---|---|---|
| Stamping Department |
Forming Department | Assembly Department | Total | |||||
| Hours required for production: | ||||||||
| Backyard Chef | ||||||||
| Master Chef | ||||||||
| Total | ||||||||
| Hourly rate | ||||||||
| Total direct labor cost | ||||||||
In: Accounting
Cl2 + 10CO2 + 6H2O 5H2C2O4 + 2ClO3- + 2H+ For the above redox reaction, assign oxidation numbers and use them to identify the element oxidized, the element reduced, the oxidizing agent and the reducing agent. name of the element oxidized: name of the element reduced: formula of the oxidizing agent: formula of the reducing agent:
In: Chemistry
After the APGAR score name 4 interventions that are performed on a neonate and the reasons for them.
Piaget’s stages of development are subdivided in four levels. Relating to his theories, why is it important to choose toys that are appropriate for children?
Name four interventions you can take to prevent accident in early childhood.
In: Nursing
Who were the three different stakeholder groups who were heavily impacted by Madoff and explain why?
In less than 150 words
I may use individual names that have been impacted
within the group. However, provide the name of the group and then
the individuals name in any way.
In: Accounting