Submit a lab report containing the following information.

 

1. Submit a lab report (a Word document) containing the following information.

·

o Include your name and the lab or lab-exercise number.

Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

Summary and Conclusions: Include a summary of what the lab demonstrated and any conclusions drawn from the testing of the lab program.

Create a new project that consists of the base class BankAccount.

The BankAccount class should contain, at minimum, the following members.

1. It should contain data members to store a bank customer’s balance and account number. These should be of different and appropriate data types.

2. It should have function members that do the following:

1. set the account number;

2. return the account number;

3. return the account balance;

4. deposit money into the account; and

5. withdraw money from the account.

The class CheckingAccount should contain, at a minimum, the following members.

1. It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented.

2. Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines.

1. The checking account is allowed three free transactions. For each successful withdrawal transaction past the three free transactions, there will be a service fee of 50 cents per transaction. The service fee should be deducted from the account balance at the time the transaction is made.

2. If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the withdrawal should be denied.

The function should return a value to indicate whether the transaction succeeded or failed. Transaction fees should be deducted only from successful transactions, but the transaction count should be incremented in either case.
The class CheckingAccount should contain, at a minimum, the following members.

1. It should contain a data member to hold the daily interest rate. The daily interest rate can be calculated from a yearly interest rate by dividing the annual rate by 365.

2. It should contain a data member to keep track of the number of days since the last transaction or balance inquiry. This should be updated using a random-number generator (reference Lab 1) that will return a value representing the number of days between 0 and 7, inclusive. We will assume that this bank is open every day of the year.

3. It should contain a data member to hold the interest earned since the last transaction or balance inquiry.

4. It should contain a function member to set the annual interest rate.

5. Utilize the base-class functions for both withdrawal and deposit operations for the savings account.

6. Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made.

7. If there are insufficient funds in the account balance to cover a withdrawal, the withdrawal should be denied. The number of days since the last transaction or balance inquiry and the interest calculations should still be made.

8. A value should be returned to indicate whether a withdrawal transaction succeeded or failed.

9. It should contain a function member to return the interest earned since the last transaction or balance inquiry.

1. It should contain a function member to return the number of days since the last transaction or balance inquiry.
ll data-input and data-display operations (cin and cout) should be done in the function main() test program.

2. The test program should create one checking account and one savings account with initial balances of $100 each using the functions defined in the class definitions. The test program should also assign a unique, five-digit account number to each account and assign an annual interest rate of 3% for the savings account.

3. The test program should then display a menu that allows the user to select which option is to be performed on which account, including the following.

1. Make a deposit and specify the amount to a selected or an entered account.

2. Make a withdrawal and specify the amount to a selected or an entered account.

3. Return the balance of a selected or an entered account.

1. For deposit transactions, withdrawal transactions, and balance inquiries, the updated balance and any fees charged or interest earned should also be displayed.

2. For the savings account, the number of days since last transaction should be displayed.

4. Exit the program.

Each account operation should display the account number and the account type.

Write a program in C or C++ or Java to display the following information.

Exercise : Write a program in C or C++ or Java to display the following information.
1. Time information.
In this section you will print out how long the system has been up and how busy it has been. Once you have some baseline numbers printed, you will run a short program that places a load on the system. You will then take a second set of numbers and calculate the load that your program placed on the system.
a. Duration of uptime # get these information from /proc/uptime
b. Duration of idletime
Calculating load average.
Write a function that does some work (to put some load on the system) and make a note of the uptime and idletime before and after the call of the function. The following can be used as sample code for the work function. This program simple runs a math calculation a large number of times, just trying to keep the CPU busy. You can include it as a function in your overall program. Note that because you are using a math function (pow) you will need to explicitly include the math library when you compile your program, i.e., “gcc –o test test.c –lm”. (the –lm option for program compiling in C or C++.)
void work()
{
double y;
double x = 3.0;
double e = 2.0;
int i,j;
for (i = 0; i < 5; i++)
{
for (j = 0; j < 400000; j++)
{
y = pow(x, e);
}
printf(“Loop %d of work cycle\n”, i );
// pause for one second between loops so that the work cycle takes a little time.
sleep (1); // in C or C++ you will need to include the unistd.h library for this function
}
}
The skeleton of the program
(1) read file “/proc/uptime” to obtain beginTotaltime and beginIdletime
(2) call work( ) to put some work into the system
(7) read file “/proc/uptime” to obtain endTotaltime and endIdletime
(8) Calculate the percentage of the time that CPU was busy during this program:
programTotalTime = endTotalTime – beginTotalTime;
programIdleTime = endIdleTime – beginIdleTime;
programWorkTime = programTotalTime – programIdleTime;
percentage = (programWorkTime / programTotalTime)* 100;
Items to turn in to Week 7 dropbox:
1. Source code with filename (linuxtime.c or linuxtime.cpp or linuxtime.java)
2. Sample output from your program
NOTE: (IMPORTANT !!!)
1. All the source file should be with enough documentation either embedded in the code or in a separate file. Insufficient documentation leads to minus points.
2. Be sure to write your name, date, assignment name and a brief description of the project on the top of the file in comments.(All of this counts towards the documentation)
3. Use the same file name as mentioned above (linuxtime.c or linuxtime.cpp or linuxtime.java) and submit it to Week 7 dropbox.
Percentage Distribution
Total : 100%
• Execution of the program with required output : 70%
• Enough Documentation : 20%
• Submitting the sample output : 5%
• Using the same file name as mentioned above : 5%

Save it as uptime.c
Compilation, as stated before: gcc -lm -o uptime uptime.c
Running: ./uptime
Here are my results:
Loop 0 of work cycle
Loop 1 of work cycle
Loop 2 of work cycle
Loop 3 of work cycle
Loop 4 of work cycle
Total time: 8.78 seconds
CPU idle time : 5.09 seconds
CPU busy time : 3.69 seconds
CPU % of time busy/total : 42%

This program will ask the user to answer a series of arithmetic problems

Assignment 7.1 [95 points]

This program will ask the user to answer a series of arithmetic problems and report on how the user performs. You will write this program in phases as specified below. Make sure that each phase works correctly and uses good style before progressing to the following phase.

Note that the purpose of this assignment is to give you lots of practice with parameter passing without making you write a huge program. For this reason I have provided a structure diagram at the end of this document. Make sure that you adhere to the structure diagram carefully.

Turn in only your final product.

Phase 1: Your main function for phase I must look exactly like this:

int main()

{

srand(time(0));

doOneSet();

}

You must write the function doOneSet which will, for now, write out 5 addition problems. All of the numbers printed should be between 0 and 100, inclusive. Here is a sample output for this phase:

45 + 21 =

0 + 100 =

54 + 23 =

4 + 19 =

18 + 92 =

The numbers that are produced for these problems must be generated randomly by the computer. The numbers in the sample output are given only as an example. Refer to lesson 7.3 for more information about generating random numbers.

Phase 2: Change your doOneSet function so that instead of just writing out the problems it also allows the user to enter an answer, and then tells the user whether the answer was correct or not. Do not change your main function. Here is the sample output for this phase (user input is indicated here by using bold font. It won’t be bold in your own output):

45 + 21 = 66

correct

0 + 100 = 100

correct

54 + 23 = 67

incorrect

4 + 19 = 13

incorrect

18 + 92 = 110

correct

Before you move on to phase 3, refer to the structure diagram at the end of this document and make sure that you have adhered to it for all of the functions indicated there for phase 2. This will probably mean dividing your doOneSet function up into functions, if you haven’t done it already.

Phase 3: Now you will change your doOneSet function so that it will work for either addition, subtraction, or multiplication. For the purposes of this assignment, a set of problems is defined to be a group of problems that are all of the same type (all addition, all subtraction, or all multiplication). After completing this phase your program will give 5 addition problems, 5 subtraction problems, and 5 multiplication problems, for a total of 15 problems. Your main function must look exactly like this:

COMP247 Data Communications

 

COMP247 Data Communications 

Assignment 2, 2014: Network Technologies 

Objectives 

These are the areas that will be tested:

 Wireless network technologies

 Wide Area networking technologies

 Internet Access Technologies

Backbone Technologies

Note 

 All assumptions must be stated clearly in your answers.

 The explanations you provide do not have to be long, concise is preferred to wandering. They do need to present your case clearly.

Questions 

1. Wireless Networks [10 marks] 

Consider a warehouse that is 60m by 30m. Wireless networking is required so that up to 20 staff members working in the warehouse can track stock movements and perform stock checks using mobile devices.

(b) [3 marks] Which WiFi flavour (a, b, g, n, ac, ad, or other) would you recommend for this new installation? Discuss the options and justify your choice. [Up to 200 words]

(c) [3 marks]Would you recommend security for this network, and if so, what type of security? Discuss the options and justify your choice. [Up to 200 words]

2. Backbone Networks [10 marks] 

A backbone network can be constructed as a switched backbone, a routed backbone or a VLAN backbone. Each of these approaches has its advantages and disadvantages.

(a) [6 marks] Discuss the advantages and disadvantages of each approach. [Up to 400 words]

(b) [2 marks]Describe an example of a situation where a switched backbone would be preferred. [Up to 150 words]

3. WANs [10 marks] 

Now! Electronics has four stores in the Sydney region (Hornsby, Penrith, Campbelltown, City) connected in a star topology by leased T-1 lines to its head office in North Ryde.

(a) [2 marks] Sketch the existing WAN, showing the stores, head office and the leased lines.

(c) [2 marks]Describe an example of a situation where a VLAN backbone would be preferred. [Up to 150 words]

(b) [1 mark] What is the maximum data capacity for traffic between Hornsby and North Ryde? What is the maximum data capacity for traffic between Hornsby and the City store? [Short answer]

(c) [3 marks]A new stock management server is to be installed to track stock in all four stores – all sales will be reported to this server as they happen. Some members of the development team want to install this new server in head office, while others want to install it in the city store because that store has 40% of the total sales. Which option do you prefer and why? [Up to 200 words]

(d) [4 marks] Now! is planning an aggressive expansion strategy with offices and stores in each Australian state. Compare the merits of expanding the existing T-1 based WAN with moving to a new MPLS-based WAN. [Up to 200 words]

Deer Creek Ski Resort Was For Many Years

Deer Creek ski resort was for many years a small, family-owned resort serving day skiers from nearby towns. Deer Creek was recently acquired by Mountain Associates, a major ski resort operator with destination resorts in several western states. The new owners have plans to upgrade the resort into a destination resort for vacationers staying for a week or more. As part of this plan, the new owners would like to make major improvements in the Lynx Lair Lodge, the resort’s on-the-hill fast-food restaurant. The menu at the Lodge is very limited—hamburgers, hot dogs, chili, tuna fish sandwiches, French fries, and packaged snacks. The previous owners of the resort had felt no urgency to upgrade the food service at the Lodge since there is little competition. If skiers want lunch on the mountain, the only alternatives are the Lynx Lair Lodge or a brown bag lunch brought from home.
As part of the deal when acquiring Deer Creek, Mountain Associates agreed to retain all of the current employees of the resort. The manager of the Lodge, while hardworking and enthusiastic, has very little experience in the restaurant business. The manager is responsible for selecting the menu, finding and training employees, and overseeing daily operations. The kitchen staff prepares food and washes dishes. The dining room staff takes orders, serves as cashiers, and cleans the dining room area.
Shortly after taking over Deer Creek, management of Mountain Associates held a day-long meeting with all of the employees of the Lynx Lair Lodge to discuss the future of the ski resort and management’s plans for the Lodge. At the end of this meeting, top management and Lodge employees created a balanced scorecard for the Lodge that would help guide operations for the coming ski season.
Almost everyone who participated in the meeting seemed to be enthusiastic about the scorecard and management’s plans for the Lodge.
The following performance measures were included on the balanced scorecard for the Lynx Lair Lodge:
• Customer satisfaction with service, as measured by customer surveys.
• Total Lynx Lair Lodge profit.
• Dining area cleanliness, as rated by a representative from Mountain Associates management.
• Average time to prepare an order.
• Customer satisfaction with menu choices, as measured by surveys.
• Average time to take an order.
• Percentage of kitchen staff completing institutional cooking course at the local community college.
• Sales.
• Percentage of dining room staff completing hospitality course at the local community college.
• Number of menu items.
Mountain Associates will pay for the costs of staff attending courses at the local community college.
Required:
1. Using the above performance measures, construct a balanced scorecard for the Lynx Lair Lodge. Use Exhibit 10–12 as a guide. Use arrows to show causal links and indicate with a + or – whether the performance measure should increase or decrease.
2. What hypotheses are built into the balanced scorecard for the Lynx Lair Lodge? Which of these hypotheses do you believe are most questionable? Why?
3. How will management know if one of the hypotheses underlying the balanced scorecard is false?

Risk And Compliances New

As an IT analyst for BallotOnline, a company providing voting solutions to a global client base, you are working to convince the organization to move the current infrastructure to the cloud.

Your supervisor and the director of IT, Sophia, has asked you to summarize for the company executives the potential risks and compliance issues that BallotOnline will have to contend with in the transition to the cloud.

The final report will be seven to 10 pages that convey your understanding and management of risks associated with cloud computing, as well as ensuring compliance with legal requirements involved in moving BallotOnline systems to the cloud.

Step 1: Research Risks Associated With Cloud Adoption

The first step in assessing risk in cloud computing will be to identify and describe risk concepts and cloud computing risk factors associated with cloud adoption. As a software as a service (SaaS) company considering an infrastructure as a service (IaaS) cloud service provider for your hosting needs, consider third party outsourcing issues and the generally accepted best practices for cloud adoption and review relevant cloud risk case studies. You should also consider best practices for cloud adoption.

As part of the risk management process, identify and describe other types of risk, such as risks associated with having a service-level agreement (SLA). An example of a potential risk could be if your company is obligated to protect personal information, and then the cloud provider that you use suffers a security breach exposing that personal information.

Here, identify and describe other types of risks or potential liability issues that apply to BallotOnline.

Step 2: Identify the Most Appropriate Guidelines for Managing Risks

In order to identify guidelines applicable to your company’s industry, you must have an understanding of the different types of risk management guidelines that exist and are frequently applicable in cloud environments.

There are several cybersecurity standards applicable to cloud computing environments such as the NIST Cybersecurity Framework, ISO standards, and US federal government standards (DoD/FIPS), as well as several major sets of risk guidelines for dealing with the risks involved. Also, there are organizations such as the Cloud Security Alliance (CSA) that recommend best practices for managing risks.

Review the different guidelines and determine which are most appropriate for BallotOnline. For example, NIST has responsibility for developing a number of elections industry guidelines within the United States.

Identify why those guidelines are most appropriate and compile these items into a brief (one page or less) recommendation and justification of your choice. Your recommendation will also be incorporated into your final report in the final step.

Submit your recommendation to Sophia to review before you present your final work.

Step 3: Identify Potential Privacy Issues and Mitigation Measures

Now that you have identified the guidelines most applicable to your organization, it is time to discuss privacy protections that may apply.

BallotOnline is now a global organization and may need to contend with several sets of privacy laws since these laws vary from country to country.

Sophia has recommended that you focus on European Union (EU) privacy requirements for now, including the General Data Protection Regulation (GDPR), since those are considered to be the most challenging for compliance. Many companies opt to host data for their European customers entirely within facilities in the European Union, and the companies implement restrictions to prevent data for EU citizens from crossing borders into non-EU zones. This is the approach that you have been asked to take and where you should focus your efforts. Note that some cloud providers, such as Amazon, have received special approval from EU authorities to permit data transfer outside of the EU.

Research EU privacy requirements, identify the requirements that apply to your project, and why they apply and compile your recommendations for complying with these requirements. These will be incorporated into your final report.

Before moving on to the next step, discuss privacy issues in one page or less, and submit it separately before you submit your final work.

Step 4: Create Risk Management Matrix

Now that you have identified and described the types of risks that may apply to your organization, create a risk management matrix to assess/analyze that risk, and make recommendations for risk mitigation measures.

This Sample Risk Assessment for Cloud Computing will give you an example of a completed risk matrix.

Use the risk management matrix template to identify risks and write a brief summary explaining how to understand the data. Submit it to Sophia for feedback before you present your final work.

Step 5: Describe Cloud Security Issues

Now that you have completed the risk analysis, you can start to identify cloud and network security issues that may apply in BallotOnline’s operating environment, including data in transit vulnerabilities and multifactor authentication.

Consider cloud computing risks, network security designinformation security, data classifications, and identity management issues. Your findings will be incorporated into your final report.

Discuss these security issues in one page or less, and submit it separately before you submit your final work.

Step 6: Examine the US Legal System and Intellectual Property Laws

Now that you are familiar with security issues, examine and review the US legal and justice systems. Since BallotOnline is a software as a service (SaaS) company based in the United States and serving a customer base in the United States, you need to understand how the legal and justice systems work in the United States. Your basic understanding of these systems is crucial for understanding the complexities of the legal system in cyberspace, where cloud-based systems reside.

As a practitioner working in the cloud computing field, you should also have an understanding of the complexities of intellectual property law and cyberspace law, including how to identify different venues and methods for resolving disputes (such as the court system, arbitration, mediation), how to define and negotiate cloud hosting agreements to avoid potential cyberspace law issues, how to discuss the regulation of cyberspace, and how to handle electronic agreements and digital signatures.

To gain a better understanding of how cyberspace laws are applied to real issues, participate in the analysis of a relevant legal case with your colleagues in a forum titled Discussion: US Legal System and Cyberspace Law.

In addition to the discussion board, your findings will also be incorporated into your Final Risk and Compliance Report for the BallotOnline executives.

Step 7: Use Frameworks to Analyze Complex Legal and Compliance Issues

In the previous step, you examined the US legal and justice systems as a building block for understanding the complexities of the legal system in cyberspace, where cloud-based systems reside.

There are several frameworks for analyzing compliance issues used to analyze these complex issues. To provide a manageable set of recommendations to the executives, review the frameworks and select the one that is most helpful to use for analyzing these complex issues.

Step 8: Analyze General, Industry, Geographic, Data, and Cloud-Specific Compliance Issues

In the previous step, you examined the complexities of law in cyberspace. In this step, you will expand your understanding of legal and compliance issues related to the cloud by investigating industry-specific compliance issues, geographic-specific compliance issues such as privacy, and cloud-specific compliance issues to determine which are applicable to BallotOnline.

You will also need to analyze data compliance issues applicable to companies operating in the European Union, including the recent GDPR regulations, and determine how BallotOnline can be compliant. The organization is concerned about EU compliance issues because the laws there are the most restrictive that BallotOnline will encounter.

Prepare a two- to three-page summary of the data compliance issues that are applicable to BallotOnline and determine how BallotOnline can be compliant. This will be part of your final risk and compliance assessment report.

Step 9: Create a Proposal for a Compliance Program

In previous steps, you have identified potential legal and compliance requirements that BallotOnline may face in migrating to a cloud computing model. Now, you need to determine how BallotOnline can comply with those requirements.

Create a high-level proposal for a compliance program for BallotOnline that enables the organization and its employees to conduct itself in a manner that is in compliance with legal and regulatory requirements. Management has asked you to model the proposal on existing compliance programs for other companies that have migrated to the cloud.

Use the Proposal for Compliance Program template to record your work and upload it to the class folder for feedback before you submit your final work.

Step 10: Write the Final Risk Assessment and Compliance Report

As you have learned, there are a number of legal and compliance requirements associated with shifting to a cloud computing model.

It’s time to put everything together in a seven- to 10-page report for BallotOnline executives: summarizing the risk assessment and mitigation as well as legal and compliance requirements associated with moving to the cloud, outlining your recommended action plans for meeting those requirements, and developing a high-level proposal for a compliance program to avoid breaches of the requirements.

Use the final risk and compliance report template to complete your report.

Use the following criteria to respond to the questions.

1.1: Organize document or presentation clearly in a manner that promotes understanding and meets the requirements of the assignment.

1.2: Develop coherent paragraphs or points so that each is internally unified and so that each functions as part of the whole document or presentation.

2.1: Identify and clearly explain the issue, question, or problem under critical consideration.

7.1: Examine legal and regulatory requirements.

7.2: Examine industry best-practices and standards.

8.1: Assess liability issues associated with cloud adoption.

8.2: Assess network security and privacy risks associated with cloud infrastructure.

8.3: Assess management and operational risks associated with cloud.

Please add references. l also need plagiarism report

  • attachment

    CH_Project2_Final_Risk_Assessment_and_Compliance_Report.docx1.pdf

Reply To Discussion Board.

Requirement for discussion board:

Response and respond to at least one other post, offering one or two paragraphs of additional insight and details. This could be additional support for their point of view, or it could be arguing a counterpoint.

Discussion Board of other student is below:

# – Is a cyberattack ever morally justified in response to an enemy conventional attack?

For the discussion topic on ethical considerations for cyber operations, I chose to answer questions 1 and 5.  According to Dipert (2010), cyber warfare and conventional warfare share commonality based on the uncertainty of the outcome of an attack, as well as any side effects that may occur as a result (p 385).  He also believes that the evidence you have to justify an attack should be weighed against the moral conditions for going to war in the first place (p 400).  Therefore, I believe a cyber-attack is morally justified in response to a conventional attack, especially if the war outcome is devasting and the cyber-attack is used prevent further destruction from happening.  My reason is based on Dipert’s (2010) description of cyber tactics in warfare using an electromagnetic force to disrupt a target’s radio communications, machinery, and infrastructure (p 397).  In conventional warfare the attacker is probably already known, and the evidence needed to justify deploying a cyber-attack is likely valid.  My decision to deploy a cyber-attack would be based on what might happen as a result of not stopping the attack.

# – Once a war (cyber- or conventional) has begun what kinds of cyberattacks are morally justified?

Dipert (2010) says that we should think about proportionality and likelihood of success when considering to what extent a cyber-attack is morally justified once a war has begun (p 392).  Based on this theory, proportionality means that however you decide to respond to a conflict, your response should be less harsh than what was inflicted on you (Pope, p 29).  Therefore, under the proportionality criteria the saying ‘eye for an eye’ may not be justified in response to war because it would suggest that I am trying to enforce equal treatment on target solely in retaliation.  I understand why proportionality should be considered in this case because, if not, it could lead to unnecessary casualties and economies being without resources, like food, housing, and utilities for a long period of time.  However, once the war has begun, the kinds of cyber-attacks that could be deployed morally would really depends on the severity or likelihood that the situation will only get worse if nothing is done to stop it.  For instance, I think dismantling electronic devices to prevent communication and machinery to keep it from functioning as it normally would, would be a morally justified cyber-attack.  I would consider taking down any resources that keep an enemy in power.  While I would also be concerned with noncombatant immunity and ensuring that innocent people do not endure inhumane conditions (Pope, 15), I would likely be less concerned with noncombatant immunity of a target if no other options existed for a cyber-attack to be morally justified.

DIVE Scoring Program

DIVE Scoring Program
Your mission: The state diving commission wants to computerize the scoring at its diving competitions. You’ve been hired to write a program to automate the scoring of dives. Following are the requirements for the program.
After each dive, the user will be prompted to enter the:
diver’s name;
diver’s city;
degree of difficulty (ranges from 1.00 to 1.67); and
scores from five judges (scores can range from 0 to 10).
If an invalid score is entered, an error message will be displayed. The user will be prompted for the score repeatedly until a valid score is entered.
The program will then display the following information:
Diver’s name
Diver’s city
Dive final score: This is calculated by dropping the highest and lowest of the five judges’ scores. The remaining three scores are added together, and the result is divided by 3 and then multiplied by the degree of difficulty.
The program will then prompt the user if she/he wants to process another dive. The user can type “Y” or “y” to continue, and “N” or “n” to quit.
Sample output:
Diver’s name: Sue Jones
Diver’s city: Dallas
Dive degree of difficulty: 1.9
Invalid degree of difficulty – Please reenter (Valid Range: 1 – 1.67)
Dive degree of difficulty: 2
Invalid degree of difficulty – Please reenter (Valid Range: 1 – 1.67)
Dive degree of difficulty: 1.2
Judge #1 score: 45
Invalid score – Please reenter (Valid Range: 0 – 10)
Judge #1 score: 3
Judge #2 score: 4.5
Judge #3 score 6.7
Judge #4 score 89
Invalid score – Please reenter (Valid Range: 0 – 10)
Judge #4 score 8
Judge #5 score: 9.2
Diver: Sue Jones
City: Dallas
Dive score: 7.68
Do you want to process another dive (Y/N)? y
Diver’s name: XXXXX XXXXX
Diver’s city: Houston
Dive degree of difficulty: 1.1
Judge #1 score: 5.7
Judge #2 score: 6.8
Judge #3 score:: 7.6
Judge #4 score: 8.7
Judge #5 score: 6.7
Diver: XXXXX XXXXX
City: Houston
Dive score: 7.74
Do you want to process another diver (Y/N)? N
Tips
Best practice: Note that a good way to implement the code is to write a first version for only a single dive without validating input. Put yourself in the place of the program. What steps would you personally need to perform in order to process a single dive yourself? Write out those steps on paper as pseudocode and/or in Visual Studio as C# XXXXX and then implement them one by one, testing as you go. After you have a single dive process working, implement one of the input validations, or the outer loop that repeats the whole process. Whichever you choose, remember to not write too much at one time. Always add and test functionality incrementally!
Pseudocode: Although there are several valid ways to write the program, the following is an outline of one way to design the overall logic.
Declare and initialize variables: name, city, judge score, highest score, lowest score, total score
Loop while there are dives to process
Get diver’s name and city
Get degree of difficulty
Loop to validate input
End Loop
Loop five times to get judges’ scores
Loop to Validate input
End Loop
Update highest and lowest scores if need be
Add score to total score
End Loop
Calculate the final score (subtract highest and lowest scores from total score, divide by 3, multiply by degree of difficulty)
Display the diver’s information and final dive score
Prompt the user if he or she wants to process another dive
End-Loop
The code and screenshots have to be on ms word

C++ Coding Assignment

Assg 02: Classes

COSC 2336 Data Structures

Objectives • Create a simple class • Practice using <cmath> math functions • Practice with C++ string types and I/O streams • Use a class constructor • Example of test driven development

Description Typically, most everyone saves money periodically for retirement. In this exercise, for simplicity, we assume that the money is put into an account that pays a fixed interest rate, and money is deposited into the account at the end of the specified period. Suppose the person saving for retirement depositsD dollarsmtimesperyear. Theaccountpaysr%compoundinterest rate. And the person will be saving for a period of t time given in years. For example, the person might save D = $500 every m = 12 months. The retirement account pays 4.8% compound interest per year. And the person as t = 25 years to save for retirement. The total amount of savings S accumulated at the end of this time is given by the formula S = Dh(1 + r/m)mt −1 r/m i For example, suppose that you deposit $500 at the end of each month (m = 12). The account pays 4.8% interest per year compounded monthly for t = 25 years. Then the total money accumulated into this account is

1

500[(1 + 0.048/12)300 −1]/(0.048/12) = 289,022.42

.

On the other hand, suppose that you want to accumulate S dollars in savings, and would like to know how much money you should deposit D each deposit period. The periodic payment you need to reach this goal S is given by the formula

D =

S(r/m) (1 + r/m)mt −1 Design a class that uses the above formulas to calculate retirement savings and to help plan retirement goals. Your class should have private instance variables (all of type double) to hold D the deposit amount, m the number of deposit periods per year, r the interest rate and t the time in years the plan will save for retirement. In the class style guidelines, I discourage using single letter variable names usually when writing code. However when we are directly implementing a formula in an engineering or scientific calculation, it is often clearer to use the variable names directly as given in the formula. For this assignment you need to perform the following tasks. 1. Create a class named RetirementAccount. The class should have a class constructor that takes the 4 variables, D, m, r, t as parameters. 2. Create a default class constructor as well. This constructor can set all of the private member variable values to 1.0. 3. You must have getter and setter methods for all 4 of the member variables of the class. The methods will be named set_D(), set_m(), set_r(), set_t() and get_D(), get_m(), get_r(), get_t(), respectively. 4. Create a member function named tostring(). This function will not take any parameters as input. It returns a string that represents the values/settings of the RetirementAccount class. See the example output below for the format of the string to be returned. 5. Create a member function named calculateRetirementSavings(). This function should implement the first formula to calculate the total amount of savings S the account will generate. This function has no parameters as inputs, and it returns a double amount (the amount of savings) as its result.

2

6. Create a member function named planRetirementDeposits(). This function takes a double parameters S as input, which is the savings goal you wish to achieve. This function should implement the second equation given above. The function returns a double result, D which is the amount of money that should be deposited each period to meet the savings goal S.

As before you will be given a starting template for this assignment. The template contains all of the tests your class and member functions should pass for this assignment. You should write your program by uncommenting the tests/code in main 1 at a time, and writing your class incrementally to work with the test. If you perform all of the above tasks correctly, the tests given to you in the starting template will produce the following correct output:

=== Testing class creation using constructor……………….

=== Testing getter methods………………. Account: D (deposit amount) = $100.00 m (periods per year) = 10.00 r (interest rate) = 0.0350 t (time in years) = 22.00

=== Testing tostring() method………………. Account: D (deposit amount) = $100.00 m (periods per year) = 10.00 r (interest rate) = 0.0350 t (time in years) = 22.00

=== Testing setter methods………………. Account: D (deposit amount) = $500.00 m (periods per year) = 12.00 r (interest rate) = 0.0480 t (time in years) = 25.00

=== Testing retirement savings calculations……………….

3

My retirement savings: $289022.42

=== Testing retirement planning calculations………………. In order to save 1 million dollars, we need to make monthly deposits of $1729.97 If we set our deposit to this new amount… Account: D (deposit amount) = $1729.97 m (periods per year) = 12.00 r (interest rate) = 0.0480 t (time in years) = 25.00

My retirement savings: $1000000.00

=== Second test on account2 of savings and planning………………. Account 2: D (deposit amount) = $650.00 m (periods per year) = 9.00 r (interest rate) = 0.0350 t (time in years) = 30.00

My retirement savings: $309521.45

In order to save 2 million dollars, we need to make deposits of $4200.03 If we set our deposit to this new amount… Account: D (deposit amount) = $4200.03 m (periods per year) = 9.00 r (interest rate) = 0.0350 t (time in years) = 30.00

My retirement savings: $2000000.00

=== Larger number of tests, compare effect of increasing monthly deposit amount………………. Plan 0: D (deposit amount) = $500.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 347024.70 Plan 1:

4

D (deposit amount) = $600.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 416429.64 Plan 2: D (deposit amount) = $700.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 485834.58 Plan 3: D (deposit amount) = $800.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 555239.52 Plan 4: D (deposit amount) = $900.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 624644.46 Plan 5: D (deposit amount) = $1000.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 694049.40 Plan 6: D (deposit amount) = $1100.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 763454.34 Plan 7: D (deposit amount) = $1200.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00

5

Total Savings: 832859.29 Plan 8: D (deposit amount) = $1300.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 902264.23 Plan 9: D (deposit amount) = $1400.00 m (periods per year) = 12.00 r (interest rate) = 0.0400 t (time in years) = 30.00 Total Savings: 971669.17

Hints • You can use the string type and string concatenation to write the required tostring() member function. For example, if I had variables x and y of type int and double, and I wanted to create a string from them to return, I could do something like

#include <string> using namespace std;

int x = 5; double y = 0.035 string s = “x (example int) = ” + to_string(x) + ‘\n’ + “y (example double) = ” + to_string(y) + ‘\n’; However, you cannot control the precision (number of decimal places shown)oftheoutputusingtheto_string()method. Iwillacceptthis, but if you want to get exactly the same output I showed in the correct output, you will need to use the string stream library <sstream>. This library allows you to create a stream, like the cout stream, but stream into a string. Thus you can use the io manipulator functions like setprecision() and fixed to format the decimal numbers. You can look at the starting template for many examples of using these I/O manipulators to format the output. • You should use the pow() function from <cmath> for calculating the

6

savings and planning the goal deposits functions. It might make it easier on you, and be more readable, to define something like:

// r is yearly rate, so amount if interest each period is // given by r/m double ratePerDeposit = r / m; // total number of deposits double numberOfDeposits = m * t; • Almost all of the code given in the template is commented out. You should start by only uncommenting the first line that creates an object using your constructor, this one:

// RetirementAccount account(100.00, 10.0, 0.035, 22.0); Get your constructor working first for your class. Then you should uncomment out the first line testing the get_D() getter method, etc. E.g. if you are not used to coding incrementally, try it out. Code only a single function and get it working before doing the next one. This is a type of test driven development.

Assignment Submission A MyLeoOnline submission folder has been created for this assignment. You should attach and upload your completed .cpp source file to the submission folder to complete this assignment.

Requirements and Grading Rubrics Program Execution, Output and Functional Requirements 1. Your program must compile, run and produce some sort of output to be graded. 0 if not satisfied. 2. 25 pts. The class must have the requested member variables. These member variables must be private. 3. 25 pts. The constructor is created and working correctly. 4. 10 pts. All setter and getter methods for the 4 member variables are implemented and work as asked for.

7

5. 10pts. YouhavecorrectlyimplementedthecalculateRetirementSavings() function, and it is calculating savings correctly. 6. 10pts. YouhavecorrectlyimplementedtheplanRetirementDeposits() function, and it it calculating goal deposits correctly. 7. 10 pts. You have correctly implemented the tostring() method. The method is returning a string (not sending directly to cout). 8. 2 pts. (bonus) You used <sstream> string streams, and have correctly formatted the string to have 2 or 4 decimal places as shown in correct output. 9. 5 pts. All output is correct and matches the correct example output. 10. 5pts. Followedclassstyleguidelines, especiallythosementionedbelow.

Program Style Your programs must conform to the style and formatting guidelines given for this class. The following is a list of the guidelines that are required for the assignment to be submitted this week.

1. Mostimportantly, makesureyoufigureouthowtosetyourindentation settings correctly. All programs must use 2 spaces for all indentation levels, and all indentation levels must be correctly indented. Also all tabsmustberemovedfromfiles,andonly2spacesusedforindentation. 2. A function header must be present for member functions you define. You must give a short description of the function, and document all of the input parameters to the function, as well as the return value and data type of the function if it returns a value for the member functions, just like for regular functions. However, setter and getter methods do not require function headers. 3. You should have a document header for your class. The class header document should give a description of the class. Also you should document all private member variables that the class manages in the class document header. 4. Do not include any statements (such as system(“pause”) or inputting a key from the user to continue) that are meant to keep the terminal from going away. Do not include any code that is specific to a single

8

operating system, such as the system(“pause”) which is Microsoft Windows specific.

(File need to be in ‘.cpp’. Use any C++ compilers but the code must be working.

Network Design Paper UMUC

Network Design Paper UMUC has recently acquired a building in Frederick,  Maryland. This new building will house some administrative offices, lecture rooms, library, and computer labs. Building dimensions: Length: 240 Feet Width: 95 Feet Height: 30 Feet The 40-year-old two-story building has the following existing layout: There will be six computer labs that will be used for instruction. Each of these labs will have 21 computers (20 student computers and 1 instructor computer). Each of these labs will also have a server in the closet located inside the lab. In addition to the six computer labs, there will also be a Student Computer Lab that will provide computer access to students to do their homework. There will be 30 computers in this lab and a server in the closet. The library will also have some computers to allow students access to the library resources. There will be 10 computers for student’s use in the library, and 5 computers for Library staff. There are five lecture classrooms in the building. Each of this room will have a computer for instructor’s use. Finally, there are various offices in the building. Each of these offices will have one computer for the staff use, with the exception of the Admission office that will have 5 computers for staff use. Equipment Inventory Workstation Placement Number of Workstations Users Total WS 6 Instructional Computer labs 21 WS Student and Instructor 132 WS (based on 20 WS for students and 1 WS for instructor on each lab) Student Computer Lab 30 WS Student 30 WS 5 various offices 5 WS Staff 5 WS Admission office 5 WS Staff 5 WS Library 10 WS Student 10 WS Library 5 WS Staff 5 WS Server Staff To be determined by students Network Connecting Devices IT Staff To be determined by students Printers To be determined by student Two server rooms have been allocated, one on the first floor and one on the second floor. Your task is to design the network for this new building with the following criteria: • Student-accessed computers should be on separate network from the staff-accessed computers. • The whole building will share one Internet access connection (T-1 link from Verizon). This connection will come into the Server Room on the first floor. • Security is very important for UMUC as we have to protect students and employees data as well as any intellectual property that UMUC has on the servers and computers. • The network has been assigned the 10.15.0.0 network address for all computers and devices. For Internet routing use 191.1.1 network address. • The network should use physical cable (not wireless), but do provide wireless access in the Student Lobby area. Submission should include (in no more than three pages, excluding diagrams and references): Network Addressing: 1. Define the subnet (based on: rooms, floor, department, or other criteria). 2. For each subnet, define the network address, subnet mask, and available IP addresses to be used by computers or devices. Physical Network Design: 1. Define the topology that will be used. 2. Select the appropriate network media to use. 3. Select the appropriate network connecting devices to use. 4. Physical layout of the computers on the floor plan. 5. List of additional servers or network devices needed to implement the network. 6. Justifications for your network design (number 1 – 5 above) You will be evaluated on your ability to o Implement appropriate IP addressing scheme o select and justify appropriate cable media that includes the length of each cable segment and number of nodes on each segment o select and justify appropriate topology such as star, bus, or ring for your network o select and justify of your selected network equipments o select and justify appropriate network services to meet network requirements o select and justify security implementation for the network o use proper grammar, formatting, network terminology, and reference citations Feel free to use any drawings or attachments, and assume any number of computers or users (not when provided here). You will be graded on the basis of right media, topology and knowledge of network concepts. Grading Rubric Criteria 0-59% 60-79% 80-89% 90-100% IP Addressing 30% Student fails to demonstrate adequate subnetting knowledge Student demonstrates some knowledge of subnetting Student demonstrates proper subnetting for the network but failed to provide all IP addressing information needed Student demonstrates proper subnetting for the network and provide all IP addressing information needed Network Requirement 40% Student fails to design proper network to address the given scenario Student misses some critical network design and/or misses on the justifications Student designs a network that address most of the requirement and are able to justify some of the design Student designs a network that met all requirements and are able to justify the design Network Technical Knowledge 20% Student does not have grade