Suppose the following letter grade class has been defined globally in a program.
#include <iostream> using namespace std;
class Grade { private:
char grade; public:
Grade(char in_grade); }; void print( );
Grade::Grade ( char in_grade) { } grade = in_grade;
void Grade::print ( ) {
cout << grade; }
1.Write a main function that reads one character from the keyboard, create a Grade object containing that character, and then have the object print itself.
2. Furthermore, create an output file (named “output.txt”), and save the character to this output file. Last, close this output file. (Answer this question).
In: Computer Science
Explain the java class below, how it make:
import java.util.*;
import java.util.concurrent.TimeUnit;
public class RacingGame {
ArrayList<Driver> player = new
ArrayList<Driver>();
CarType car = new
CarType("Ferrari","2018",280,90,15);
Formula formula = new Formula(5);// number of
laps
long startTime = System.currentTimeMillis();
long currentTime = System.currentTimeMillis();
int totalDis = 0;
public static void main(String[] args)
{
RacingGame formulaRace = new
RacingGame();
formulaRace.player.add(new
Driver("Saleh",10,3));
formulaRace.formula.setDistance(20);//lap distance
formulaRace.totalDis =
formulaRace.formula.getTotalDistance();
formulaRace.formula.setDistance(formulaRace.totalDis);
formulaRace.raceStatus();
}
public void raceStatus()
{
int newSpeed = 0;
long diff = 0;
long sec = 0;
while (formula.distance >
0)
{
currentTime =
System.currentTimeMillis();
diff =
currentTime - startTime;
sec =
diff/1000;
newSpeed = (int)
sec * car.getAcceleration();
car.setSpeed((int)(newSpeed + (newSpeed*
((double)player.get(0).getExperince()/10) *
((double)player.get(0).getLevel()/100))));
int newDistance
= (int) (formula.distance - ((car.getSpeed()*sec))/3600);
formula.setDistance(newDistance);
int
traveledDistance = totalDis - newDistance;
System.out.println("Driver name: " + player.get(0).getPlayerName()
+ ", current Speed: " + car.getSpeed() + " km/h, Traveled distance:
" + traveledDistance + " km");
try {
TimeUnit.SECONDS.sleep(1);
} catch
(InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("Driver name: "
+ player.get(0).getPlayerName() + " finished the race in " + sec +
" seconds");
}
}
//Driver(String playerName, int year, int level, String
experienceType)
//CarType(String model, String year, int maxSpeed, int balance,
double acceleration)
In: Computer Science
This question is to let you understand the impact of radio channel condition on wireless transmission and to learn how performance may be improved by re-transmitting small ACK packets.
A satellite is orbiting the earth at the geostationary orbit. It relays packets between two ground stations on the surface of the earth. The distance between the satellite and the ground stations is 72000 km. Ground station A sends a 1500 bytes packet to the satellite and the satellite forwards it (after it has been completely and successfully received by the satellite) to the ground station B. Ground station B replies with a 30 bytes ACK which is subsequently received by the satellite and forwarded to ground station A (again, it is forwarded, after the satellite has completely and successfully received the ACK packet.) Assume that the bit error rate of the channel from ground station to satellite (and vice versa) is 10^(-5). Assume that the ground station A knows exactly the time at which the ACK would have to be received for its transmitted packet. If an error-free ACK has not been received by that time, the ground station A re-sends the data packet. Let the propagation delay be at the speed of light. Also assume that the data transmission speed on all stations and the satellite to be 1Mb/sec.
What is the average time it takes until the packet is confirmed as delivered (time between start of first transmission from ground station A until an error-free ACK has been completely received by the ground station A)? What is the average time it takes if the bit error rate is degraded to 10^(-3)?
In: Computer Science
javascript
9. “User Info”, submenu of “Setting”.
9.1 _____ (10 pts) A submenu is under “setting”. When the user
clicks on “User Info”, a pop up window
should display the user information (name, gender).
index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="navbar">
<div class="subnav">
<button class="subnavbtn">File <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<input id="csvfile" type="file" style="display:none" />
<a href="#" id="loadCSV">Load CSV file</a>
<a href="#" id='navLoginDB' onclick="return loginDB('show');">Login to DB</a>
<a href="#" id='navLogoutDB' onclick="return logoutDB();">Logout DB</a>
<a href="#">Exit</a>
</div>
</div>
<div class="subnav">
<button class="subnavbtn">View <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<a href="#">Line</a>
<a href="#">Pie</a>
<a href="#">Bar</a>
<a href="#">Map</a>
</div>
</div>
<div class="subnav">
<button class="subnavbtn">Setting <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<a href="#link1">User Info</a>
</div>
</div>
<div class="subnav">
<button class="subnavbtn">Help <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<a href="#">Info</a>
<a href="#">Client</a>
</div>
</div>
</div>
<div id="dvCSV">
</div>
<script>
$(document).ready(function () {
var browserSupportFileUpload = function () {
var isCompatible = false;
if (window.File && window.FileReader && window.FileList && window.Blob) {
isCompatible = true;
}
return isCompatible;
};
if (browserSupportFileUpload()) {
document.getElementById('csvfile').addEventListener('change', uploadFile, false);
} else {
$("#message").html('The File APIs is not fully supported in thie browser. please use another browser.');
}
$(function () {
$("#loadCSV").click(function(e){
//$("#loadCSV").on('click', function (e) {
e.preventDefault();
$("#csvfile:hidden").trigger('click');
});
});
var uploadFile = function (event) {
var file = event.target.files[0];
var fileformat;
if (file.name.indexOf("csv") != -1) {
fileformat = true;
}
else {
fileformat = false;
}
var reader = new FileReader();
reader.readAsText(file);
reader.onload = function (event) {
if ((file.size / Math.pow(1024, 3)) > navigator.deviceMemory) {
document.getElementById("message").innerHTML = "The data requires more memory than the client can offer";
}
else if (!fileformat) {
document.getElementById("message").innerHTML = "The data is in wrong format. Only CSV file can be loaded!";
}
else {
createArray($.csv.toArrays(event.target.result));
}
};
};
function createArray(data) {
if (data !== null && data !== "" && data.length > 1) {
this.CSVdata = data;
document.getElementById("message").innerHTML = " File upload successful with" + ((CSVdata.length) - 1) + " records! lower threshold is:" + highlight('OutlierL') + " upper threshold is: " + highlight('OutlierU');
var wage = findAvg('Avg');
var pop = findAvg('Pop');
if (getCookie("p1UserName") != "") {
var uname = getCookie("p1UserName");
$.ajax({
url: "",
type: 'POST',
async: false,
data: {
uname: uname
},
success: function (response) {
var dd = JSON.parse(response);
console.log(dd);
wage = parseFloat(dd[0][0]);
pop = parseFloat(dd[0][1]);
}
});
}
}
}
}
);
</script>
</body>
</html>
style.css
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}
.navbar {
overflow: hidden;
background-color: #333;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.subnav {
float: left;
overflow: hidden;
}
.subnav .subnavbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .subnav:hover .subnavbtn {
background-color: red;
}
.subnav-content {
display: none;
position: absolute;
left: 0;
background-color: red;
width: 100%;
z-index: 1;
}
.subnav-content a {
float: left;
color: white;
text-decoration: none;
}
.subnav-content a:hover {
background-color: #eee;
color: black;
}
.subnav:hover .subnav-content {
display: block;
}
#upload {
display: block;
visibility: hidden;
width: 0;
height: 0;
}
table {
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
In: Computer Science
The speed at which a processor can process instructions can be increased by making its clock speed higher, or by increasing the amount of L1 cache memory on the processor chip.
Explain the terms clock speed and L1 cache and briefly discuss how increasing each of them increases the speed at which instructions can be processed.
The maximum word limit for Question 3(a) is 150 words.
b.You have the choice of buying two processors:
In order to decide which to buy, you decide to estimate the time each processor will take to process a program with 10,000 RISC instructions. Each RISC instruction takes one clock pulse to execute once it is in the registers, and has a size of 4 bytes.
How much time is needed to load all 10,000 instructions into the registers for each processor. Write your answers in seconds, using scientific notation.
You may assume that no data is needed for this test program. in each case you will only need to calculate the time to move 10,000 instructions into the registers and the time to execute the 10,000 instructions. You will then find the total time for each processor by adding these two values.
Write your answers in seconds, using scientific notation.
In: Computer Science
NOTE THAT
((This should be done by R studio !))
Q: Upload your data as a CSV in R studio, then do
any
cleaning or convert needed for example convert the date in your
table
from character to date and NA identifiers . After
do all these, run a summary statistics
Year |
REX |
OilP |
Food exports (% of merchandise exports) |
Ores and metals exports (% of merchandise exports) |
1980 |
239.5433424 |
35.52 |
0.09638294 |
0.060083757 |
1981 |
240.3102173 |
34 |
0.094079554 |
0.024360528 |
1982 |
245.3895131 |
32.38 |
0.128489839 |
0.025668368 |
1983 |
242.8677506 |
29.04 |
.. |
.. |
1984 |
238.0284197 |
28.2 |
.. |
.. |
1985 |
221.878717 |
27.01 |
0.259787311 |
0.116943755 |
1986 |
169.6457184 |
13.53 |
.. |
.. |
1987 |
144.1934823 |
17.73 |
.. |
.. |
1988 |
134.5212315 |
14.24 |
1.371078529 |
0.732151804 |
1989 |
136.0536024 |
17.31 |
1.374888969 |
0.834330299 |
1990 |
125.5311345 |
22.26 |
0.713126234 |
0.491007478 |
1991 |
125.8812467 |
18.62 |
0.526384845 |
0.242750346 |
1992 |
118.7733668 |
18.44 |
1.074388363 |
0.548851562 |
1993 |
122.2521688 |
16.33 |
0.982275388 |
0.429968062 |
1994 |
117.8952881 |
15.53 |
0.673955645 |
0.346686956 |
1995 |
114.1213899 |
16.86 |
0.810242733 |
0.567217625 |
1996 |
116.3114665 |
20.29 |
0.632336949 |
0.304958406 |
1997 |
121.4661302 |
18.86 |
.. |
.. |
1998 |
127.1948915 |
12.28 |
1.114818605 |
0.507089276 |
1999 |
121.9490893 |
17.44 |
0.930990348 |
0.262574488 |
2000 |
123.200674 |
27.6 |
0.538501429 |
0.147164016 |
2001 |
125.2424379 |
23.12 |
0.558465111 |
0.201693533 |
2002 |
121.5455166 |
24.36 |
0.628539417 |
0.223275991 |
2003 |
111.1523893 |
28.1 |
0.835851768 |
0.182707717 |
2004 |
103.4682918 |
36.05 |
0.7405123 |
0.172800798 |
2005 |
100.5070052 |
50.59 |
0.620831971 |
0.137293785 |
2006 |
98.93290899 |
61 |
0.64203501 |
0.219532433 |
2007 |
95.96813741 |
69.04 |
0.838923226 |
0.283587719 |
2008 |
93.62494305 |
94.1 |
0.744029125 |
0.221986187 |
2009 |
100.1652448 |
60.86 |
1.407633083 |
0.232499732 |
2010 |
100 |
77.38 |
1.155876888 |
0.154654215 |
2011 |
96.57013945 |
107.46 |
0.898301922 |
0.122271232 |
2012 |
99.61967144 |
109.45 |
0.860627792 |
0.138455596 |
2013 |
102.3680362 |
105.87 |
0.878931429 |
0.403127249 |
2014 |
105.3894897 |
96.29 |
1.006265279 |
0.769034983 |
2015 |
118.5851177 |
49.49 |
1.798068624 |
1.307540253 |
R ONLY !!
In: Computer Science
System Analysis and Design
On the Spot Courier Services
As On the Spot Courier Services continues to grow, Bill discovers that he can provide much better services to his customers if he utilizes some of the technology that is currently available. For example, it will allow him to maintain frequent communication with his delivery trucks, which could save transportation and labor costs by making the pickup and delivery operations more efficient. This would allow him to serve his customers better. Of course, a more sophisticated system will be needed, but Bill's development consultant has assured him that a straightforward and not-too complex solution can be developed.
Here is how Bill wants his business to operate. Each truck will have a morning and afternoon delivery and pickup run. Each driver will have a portable digital device with a touch screen. The driver will be able to view his or her scheduled pickups and deliveries for that run. (Note: This process will require a new use case something the Agile development methodology predicted would happen.) However, because the trucks will maintain frequent contact with the home office via telephony Internet access, the pickup/delivery schedule can be updated in real time even during a run. Rather than maintain constant contact, Bill decides that it will be sufficient if the digital device synchronizes with the home office whenever a pickup or delivery is made. At those points in time, the route schedule can be updated with appropriate information.
Previously, customers were able to either call On the Spot and request a package pickup or visit the company's Web site to schedule a pickup. Once customers lugged in, they could go to a Web page that allowed them to enter information about each package, including "deliver to" addresses, size and weight category information, and type of service requested. On the Spot provided "three hour," "same day," and "overnight- services. To facilitate customer self-service, On the Spot didn't require exact weights and sizes, but there were predefined size and weight categories from which the customer could choose.
Once the customer entered the information for all the packages, the system would calculate the cost and then print mailing labels and receipts. Depending on the type of service requested and the proximity of a delivery truck, the system would schedule an immediate pickup or one for later that day. It would display this information so the customer would immediately know when to expect the pickup.
Picking up packages was a fairly straight forward process. But there was some variation in what would happen depending on what information was in the system and whether the packages were already labeled. Upon arriving at the scheduled pickup location, the driver would have the system display any package information available for this customer. If the system already had information on the packages, the driver would simply verify that the correct information was already in the system for the packages. The driver could also make such changes as correcting the address, deleting packages, or adding new packages. If this were a cash customer, the driver would collect any money and enter that into the system. Using a portable printer from the van, the driver could print a receipt for the customer as necessary. If there were new packages that weren't in the system, the driver would enter the required information and also print mailing labels with his portable printer.
One other service that customers required was to be able to track the delivery status of their packages. The system needed to track the status of a package from the first time it "knew" about the package until it was delivered. Such statuses as "ready for pickup," "picked up," "arrived at warehouse," "out for delivery," and "delivered" were important. Usually, a package would follow through all the statuses, but due to the sophistication of the scheduling and delivery algorithm, a package would sometimes be picked up and delivered on the same delivery run. Bill also decided to add a status of "canceled" for those packages that were scheduled to be picked up but ended up not being sent.
a. Draw a Domain Class Diagram of your entire system.
b. For the Use Case Request a Package Pickup:
i.Write a Fully Developed Use Case description.
ii. Draw an Activity Diagram.
iii. Draw an SSD.
In: Computer Science
For this week let’s discuss the concepts of primary keys and table indexes.
Give some examples of data types and fields that you might use for certain scenarios and also what types are not good to use.
In: Computer Science
13.10 Assessment
1. Which of the following groups should be included in an effort to develop an effective community of practice?
a. Senior management
b. Middle managers
c. Information security personnel
d. Users
e. All of the above
f. None of the above
2. Changing the developer’s mindset and culture requires leadership, but also policy.
a. True
b. False
3. NIST publication 800-30 promotes the integration of risk management practices into the Software Development Lifecycle (SDLC) using the ___.
a. Comprehensive Assessment Plan
b. 2009 Risk Management Methodology
c. Nine-step risk-assessment methodology
d. SSDLC Methodology Outline
4. HIPAA’s Title II deals with standards that relate to ___.
a. Data systems that process and transmit PHI
b. A child’s right to privacy
c. Encryption of PHI
d. Email use in the organization
e. All of the above
f. None of the above
5. The CIO is responsible for the oversight of all data and information that flows in and out of the organization.
a. True
b. False
6. The Family Educational Rights and Privacy Act (FERPA) applies to colleges and universities and any records that provide ___ of the student.
a. Personal identification
b. Document losses to the organization
c. Student library cards
d. Auditing software records
7. Security awareness and training is essential to developing an employee force that is aware of the threats that are imminent to an organization.
a. True
b. False
8. Policy enforcement can be done by using nontechnical controls only.
a. True
b. False
9. Tacit knowledge is easy to transfer to users throughout the organization.
a. True
b. False
10. An organization’s security policies should align with the following option or options:
a. Risk management
b. Federal regulations
c. Local laws
d. All of the above
In: Computer Science
Let A[1 · · · n] be an array of n elements and B[1 · · · m] an array of m elements. We assume that m ≤ n. Note that neither A nor B is sorted. The problem is to compute the number of elements of A that are smaller than B[i] for each element B[i] with 1 ≤ i ≤ m. For example, let A be {30, 20, 100, 60, 90, 10, 40, 50, 80, 70} of ten elements. Let B be {60, 35, 73} of three elements. Then, your answer should be the following: for 60, return 5 (because there are 5 numbers in A smaller than 60); for 35, return 3; for 73, return 7.
(a) Design an O(mn) time algorithm for the problem. (10 points)
(b) Improve your algorithm to O(n log m) time. (20 points) Hint: Use the divide and conquer technique. Since m ≤ n, you cannot sort the array A because that would take O(n log n) time, which is not O(n log m) as m may be much smaller than n.
Note: For this problem, you need to describe the main idea of your algorithms and briefly analyze their time complexities. You will receive the full 30 points if you give an O(n log m) time algorithm directly for (b) without giving any algorithm for (a).
In: Computer Science
Overview Your assignment is to complete a network diagram for a small company. You will place a number of network elements on the diagram and label them appropriately. A network diagram is important to communicate the design features of a network between network administrators, system administrators, and cyber-security analysts. It helps to create a shared mental model between these different technologists, yet each will have their own perspective on what is important to have documented on the diagram. Please review a description of ABC Corporation’s network resources and how they are allocated. ABC Corporation’s Network Description ABC Corporation is a small business in the heart of Central Pennsylvania. They provide services to their clients all over the region. The three-story main office building is where all of the employees report to work each day. There are no remote users. ABC Corporation is a very traditional business. While they have a computer network and are connected to the Internet, they aren’t very fancy and don’t yet have a need for telecommuting, wireless networks, or smart phones. All of their computers are desktop machines and are connected with wired Ethernet connections. All of the network wiring is CAT-6 twisted pair wiring that goes from the office location to a wiring closet. There is one wiring closet on each floor. Each closet is connected to the basement wiring closet via fiber. There are several departments of the company. The administrative office has ten employees including the CEO, executive Vice-President, a human resources manager, and several assistants and secretaries. The finance office has fifteen employees. Both of these divisions are on the third floor. The second floor has the Sales and R&D departments. There are a total of twenty employees in the Sales Department and includes sales executives and assistants. All of the sales department personnel have laptop computers, but they are still connected via the wired network. The R&D department has ten engineers who have two computers each – one in their office and one in their lab spaces. The first floor has the shipping/receiving department, manufacturing department, and the receptionist. The receptionist shares a computer with the night watchman, since they work opposite shifts. There are twenty people in manufacturing, but they only use three computers to enter their production details into the company’s ERP system. The shipping/receiving department has six people, each with a computer that connects to UPS, Fedex, and USPS systems, prints packaging labels and shipping documents. There is also a conference room/training room on the first floor with a multimedia system that includes a podium computer, projector, and all of the bells and whistles. The basement houses the maintenance department, information technology, and the mail room. The mail room clerk doesn’t use the computers at all. The two maintenance workers have computers at their desks that they use to enter reports of work performed. The IT Department has seven employees, each with a desktop computer. They also manage the server farm, which includes two domain controllers, one print server, one mail server, one database server, one internal web server, one external web server (on the DMZ interface of the firewall), a file server, a special server for the ERP system, and a backup server. Layer 2/3 Network Devices Each floor needs to have an Ethernet switch in its network closet. Determine the number of ports that are needed on each floor. Don’t forget the basement. The server farm and DMZ each will need to have its own switch, separated from the users’ network. Each switch connects to a centralized router on a different interface, giving one subnetwork for each floor of the network, plus one for the server farm, one for the DMZ, and one for the Internet. Determine how many ports the router needs. IP Address Assignments The router will perform Network Address Translation between the local network and the Internet. Therefore, for each sub-network, assign a CIDR /24 sized network from the IANA private range of 172.28.0.0/16. One network should get 172.28.1.0/24, the next should get 172.28.2.0/24, the next should get 172.28.3.0/24 etc. While you could optimize the use of the IP range by using smaller subnets, this is not required in this assignment. Create a Network Diagram Your network diagram needs to include the following elements: • An Internet Service Provider Network (represented as a cloud) • Router with enough ports to meet the needs of the organization • A switch for each floor – you will need to identify how many ports each switch on each floor needs to have • You DO NOT need to show every single computer on your diagram. However, you need to show groups of computers, plus their use. So, if there are 5 people in the same department, you can show all 5 computers with one icon/glyph and label it appropriately. • Each grouping of computers needs to have the IP Address range documented on the diagram. Assign the x.x.x.1 address of each network to the appropriate port on the router. Network Documentation Your network design document needs to explain each element of the network. Each Layer two (switch) and Layer three (Router) device needs to be described in terms of number of ports. The number of computers for each department and floor also needs to be documented. The IP address ranges need to be explained – including the IP Address range that you assigned, the number of IP Addresses that the subnetwork will use, and the number of IP addresses that remain unused in that subnet. What to Turn In For assignments that require you to submit Visio work, please export your file and submit as a PDF. Also, please submit your original Visio file. You also need to turn in a Word document (.doc or .docx) file that explains your network diagram elements. Include snapshots from your network diagram in your Word document – and annotate your diagram snapshots to better help your explanation of your network.
In: Computer Science
Q3: Exhibit the research methodology associated formulating the research problem, extensive literature survey, development of working hypotheses and preparing the research design?
Mention the references at the end.
Solution to be typed up to 500 words.
In: Computer Science
programming language is in excel VB8
Program 2: Software Sales A software company sells three packages, Package A, Package B, and Package C, which retail for $99, $199, and $299, respectively. Quantity discounts are given according to the following table: Quantity Discount 10 through 19 20% 20 through 49 30% 50 through 99 40% 100 or more 50% Create an application that allows the user to enter the number of units sold for each software package. The application should calculate and display the order amounts and the grand total. ENGR 1100 Asignación #2 - DECISIONS Deadline: Lunes 19 de octubre 2020, 11:50pm Input validation: Make sure the number of units for each package is not negative. Use the following test data to determine if the application is calculating properly: Units Sold Amount of Order Package A: 15 units Package A: $1,188.00 Package B: 75 units Package B: $8,955.00 Package C: 120 units Package C: $17,940.00 Grand Total: $28,083.00
programming language is in excel VB8
In: Computer Science
Discuss how Bitcoin blockchain addresses the five security objectives.
In: Computer Science
Q#4: Describe the important concepts relating to research design based on the understandings of dependent and independent variables, extraneous variable, control, confounded relationship and research hypothesis?
Mention the references at the end.
Solution to be typed up to 500 words.
In: Computer Science