Computer Science homework help

Database Systems

Introduction to Database Systems

Project Description

This project is based on the material in textbook Chapter 3 – Chapter 5, and Appendix A sections 2 – 5. All the references on figures, chapters/sections

 

The database for Wedgewood Pacific (WP) has been discussed extensively in Chapter 3 as well as in the “Working with Microsoft Access” in Chapter 1 and Chapter 2.

Complete the following four tasks using MySQL (Community Server 8.0 and the Workbench).

Create one document file (Microsoft Word or PDF format) that contains all your SQL scripts (in text format) and clear screenshots (with brief explanation) for all 4 parts.

1. Create the Wedgewood Pacific (WP) database as described in Chapter 3. This will include:

a. Creating the WP schema, and setting it as the default schema.

b. Creating a folder to hold SQL scripts for the WP schema in the C:/Documents/MySQL Workbench/Schemas folder.

c. Creating and running an SQL script named WP-Create-Tables based on Figure 3-7 (page

152) to create the WP table structure.

d. Creating and running an SQL script named WP-Insert-Datas based on Figure 3-11 (pages 159 – 161) to populate the WP tables.

What to turn in?

· Provide screenshots (similar to Figure A-19 and Figure A-20) with a brief explanation to demonstrate that you have completed this task.

 

 

2. Write an SQL query to answer the bolded question below based on the WP database that you have created in part 1.

Who are the employees assigned to projects run by the Sales and Marketing DepartmentThe result should be sorted by ProjectID in ascending order, and contain the following information: ProjectID, ProjectName, Department, DepartmentPhone, EmployeeNumber, LastName, FirstName, and OfficePhone.

What to turn in?

· A copy of your SQL script (in text format, not screenshot image);

· A screenshot of the results of running the query.

 

 

3. Wedgewood Pacific (WP) has decided to keep track of computers used by the employees. To do so, two new tables are added to the database. The schema for these tables, as related to the existing EMPLOYEE table, along with the referential integrity constraints, are shown in question WA.3.3 (pages 241 – 244). In addition, Figure 3-31Figure 3-32Figure 3-33, and Figure 3-34 are the corresponding database column characteristics for the tables and table data.

 

The schema for these tables is (note that we are purposely excluding the recursive relationship in EMPLOYEE at this time):

The referential integrity constraints:

 

 

Write an SQL query to answer the following question:

Who is currently using which computer at WP?

The result should be sorted first by Department and then by employee LastName, and contain the following information: SerialNumber, Make, Model, EmployeeID, LastName, FirstName, Department, and OfficePhone.

What to turn in?

· A copy of your SQL script (in text format, not screenshot image);

· A screenshot of the results of running the query.

 

4. Using an IE Crow’s Foot E-R diagram, Figure 5-17 (page 365) and Figure A-67 (page A-73) show the database design for the Wedgewood Pacific database (including the recursive relationship for EMPLOYEE) in MySQL Workbench. See Appendix A section 5 (pages A-56 to A-74) for more details.

Use MySQL Workbench to enhance this E-R diagram (Figure 5-17 or Figure A-67) with the COMPUTER and COMPUTER_ASSIGNMENT tables as mentioned in the previous part.

What to turn in?

· A screenshot of the completed E-R diagram.

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Software Architecture And Design

Software Architecture And Design

Trent University COIS 3040H

Assignment #1 Due Feb. 13th, 2015 (submit online by 11:59pm)

1. [20 marks] Consider an automated banking system. Customers access the ABM terminal to deposit or withdraw money or pay bills. TrentMoney wants to set up generic ABMs to cash in on transaction fees. We need to come up with a software architecture that covers the entire system – ABM terminals, Interac, banking servers, and the companies receiving monies for bills. We may not know exactly how the banking servers deal with transactions but we can show the components that they would need and suggest possibilities for communication. Your first step is to identify the components in the system and possible connectors. Then you’ll need to consider the three parts of a software architecture: elements, form, rationale. Then I want you to develop three alternative software architectures for TrentMoney. For each of these provide:

• A description of the architectural style and the rationale for this choice • A description of any architectural patterns chosen and the rationale for these choices • A topological diagram of the system • A deployment diagram of the system

You should submit a professional looking report containing the three alternatives for the software architecture for TrentMoney along with the supporting information. You should also include a recommendation for the architecture that you prefer along with the rationale for your choice. 2. [20 marks] Find 5 examples of software projects that have failed due to faulty design. Describe the reasons for the failure, whether it was caused by an accidental or essential difficulty, and provide solutions for how they could have avoided the failure. 3. [20 marks] Search the Internet for software design tools. Select one of them to write a 1 to 2 pages report on the application of the tool. Your report should including the following:

• Background information – company (URL), motivation of development and purpose of the tool;

• Application – how to use the product (example); • Input/Output and user Interface; • Cost and Product reviews – are there any outside reviews of the product, if so find

them and summarize the review; • Possible references.

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Programming assignment

Programming assignment

Again every programming assignment must include the python program and a file with snap-shots of the program running like the case study. You should at least have two files uploaded.

1.         Teachers in most school districts are paid on a schedule that provides a salary based on their number of years of teaching experience. For example, a beginning teacher in the Lexington School District might be paid $30,000 the first year. For each year of experience after this first year, up to 10 years, the teacher receives a 2% increase over the preceding value. Write a program that displays a salary schedule, in tabular format, for teachers in a school district. The inputs are the starting salary, the percentage increase, and the number of years in the schedule. Each row in the schedule should contain the year number and the salary for that year.

 

2.         The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment. Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan. Each row of the table should contain the following items:

•           the month number (beginning with 1)

•          the current total balance owed

•           the interest owed for that month

•           the amount of principal owed for that month

•          the payment for that month

•           the balance remaining after payment

The amount of interest for a month is equal to balance * rate / 12. The amount of principal for a month is equal to the monthly payment minus the interest owed.

 

Hints: on formatting tabular data.

# type this in the console of python

for exponent in range(7,11):

print(exponent, 10 ** exponent) #then hit enter two times to see results

# also try print(“%-3d12d” % (exponent, 10  ** exponent))

#Right Justified

“%6s” % “four”

#Left Justified

“%-6s” % “four”

 

#for float %<field wisth>,<presision>f

“%6,3f” % 3.14

#observe the results

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Packet Tracker assignment Help 

Packet Tracker assignment Help

Assignment 2: Packet Tracer Task

Top of Form

Hide Assignment Information
Turnitin®
Turnitin® enabledThis assignment will be submitted to Turnitin®.
Instructions
Simulating and Testing Network Configurations

As a network administrator for Bacon Institute, you will need to become familiar with the Packet Tracer simulation tool from Cisco. Packet Tracer is used to simulate and test network configurations. This allows you to work out and improve upon the settings before implementing them.

Using the diagram and configuration information from your first task, create a Packet Tracer simulation.

Submit your .pkt (Packet Tracer) file to the box below.

Review the syllabus for information about late policies and resubmitted assignments.

 

Simulating and Testing Network   Configurations

As a network administrator for   Bacon Institute, you will need to become familiar with the Packet Tracer simulation   tool from Cisco. Packet Tracer is used to simulate and test network   configurations. This allows you to work out and improve upon the settings   before implementing them.

Using the diagram and   configuration information from your first task, create a Packet Tracer   simulation.

Submit your .pkt (Packet Tracer)   file to the box below.

Review the syllabus for   information about late policies and resubmitted assignments.

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Using Agile Techniques The Students Will Design A Personal Environment Network.

Using Agile Techniques The Students Will Design A Personal Environment Network.

Project:

Using Agile Techniques the students will design an Personal Environment Network. This will involve each student identifying and classifying which components need addressing and how, using Agile development, this will be achieved. The final outcomes of this will a document or documents addressing these components, (Communication, planning, modeling, construction and deployment).

Organization and Flow:

• Project planning

• Use case development

• Requirement gathering

• Rapid design

• Code generation

• Testing

Area of work:

Using Agile Techniques the students will design an Personal Enviroment Network, This will involve in-class collaboration among the class students as they identify and classify which components need addressing and how, using Agile development, this will be achieved. The final outcomes of this

will a document or documents addressing these components, (Communication, planning, modeling, construction and deployment). The assignment will be further discussed during the lectures including time for students to discuss and work on the project.

Customer Requirements will be discussed in class

Overview:

A personal Environment Network is a network of ad-hoc device (cell phones or other WIFI wireless devices) that organize themselves into an active network to exchange information that is determined by each individual device. The application that allows the information exchange is responsible for security, look and feel and protocol. The underlining communication protocol is also part of the application. Furthermore, the application is capable of routing thru a node to get a link to a node outside a original nodes transmission range. These devices do not need any cell tower requirements, although it is possible.

According to Wikipedia these devices follow this definition:

A mobile ad hoc network (MANET), is a self-configuring infrastructure-less network of mobile devices connected by wireless links. ad hoc is Latin and means “for this purpose”. [1] [2]

Each device in a MANET is free to move independently in any direction, and will therefore change its links to other devices frequently. Each must forward traffic unrelated to its own use, and therefore be a router. The primary challenge in building a MANET is equipping each device to continuously maintain the information required to properly route traffic. Such networks may operate by themselves or may be connected to the larger Internet. MANETs are a kind of wireless ad hoc networks that usually has a routable networking environment on top of a Link Layer ad hoc network.

The growth of laptops and 802.11/Wi-Fi wireless networking have made MANETs a popular research topic since the mid 1990s. Many academic papers evaluate protocols and their abilities, assuming varying degrees of

mobility within a bounded space, usually with all nodes within a few hops of each other.

Different protocols are then evaluated based on measure such as the packet drop rate, the overhead introduced by the routing protocol, end-to-end packet delays, network throughput etc. Use case:

The user of the device sets their device to accept information from:

• Friends

• Ads by category

• Classmates (for example course 680)

• Device specifications in stores

• Home appliance devices

 

Classification of some simple use cases:

1) Item identification and location

2) ad-hoc social networking

3) ad-hoc phone services (vs. cellular phone service)

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Assignment Programming

Assignment Programming

CPSC 120 Spring 2014

Lab 9

Practice Objectives of this Lab:

1. Modular Programming

2. Defining and Calling Functions

3. Function Prototypes

4. Sending Data into a Function

5. Passing Data by Value

6. The return Statement

7. Returning a Value from a Function

8. Returning a Boolean Value

9. Using Functions in a Menu-Driven Program

10. Local and Global Variables

11. Arrays as Function Arguments

12. Static Local Variables

13. Using Reference Variables as Parameters

Grading:

1. 9.1 10 points

9.2-9.7 15 points each

100 points totally

2. Your final complete solution report is due at 11:50 PM on Monday, 05/19/2014.

To begin

· Log on to your system and create a folder named Lab9 in your work space.

· Start the C++ IDE (Visual Studio) and create a project named Lab9.

LAB 9.1 – TRY IT: Working with Functions and Function Calls

Step 1: Add the tryIt6A.cpp program in your Lab6 folder to the project. Below is a partial listing of the source code.

1 // Lab 6 tryIt6A

12 /***** main *****/ 13 int main() 14 { int value = 2; 15 16 cout << “Hello from main.\n”; 17 printMessage(); 18 19 cout << “\nValue returned by tripleIt is ” 20 << tripleIt(value) << endl; 21 cout << “In main value now is ” 22 << value << endl << endl; 23 24 value = tripleIt(value); 25 cout << “In main value now is ” 26 << value << endl; 27 28 value = tripleIt(value); 29 cout << “In main value now is ” 30 << value << endl << endl; 31 32 cout << “Goodbye from main.\n”; 33 return 0; 34 } 35 36 /***** printMessage *****/ 37 void printMessage() 38 { 39 cout << “Hello from PrintMessage.\n”; 40 } 41 42 /***** tripleIt *****/ 43 int tripleIt(int someNum) 44 { 45 return someNum * someNum * someNum; 46 }

Expected Output
  Observed Output

Step 2: Read the source code, paying special attention to the flow of control from main to the functions it calls and then back to main again. Notice what main passes to each function and what, if anything, the function return. Once you have done this, complete the “Expected Output” box in the table above, writing down what the program will display in the order it will be displayed.

Step 3: Now compile and run the tryIt6A.cpp program, and look at the output it creates. If the actual output matches what you wrote down, just place a checkmark in the “Observed Output” box. If it is not the same, write down the actual output.

LAB 9.2 – Using a void Function

Step 1: Remove tryIt6A.cpp from the project and add the fortunes.cpp program in your Lab6 folder to the project. Below is a copy of the source code.

1 // Lab 6 fortunes.cpp 2 // This fortune telling program will be modified to use a void function. 3 // PUT YOUR NAME HERE. 4 #include <iostream> 5 #include <cmath> 6 using namespace std; 7 8 // Function prototype 9 // WRITE A PROTOTYPE FOR THE tellFortune FUNCTION HERE. 10 11 /***** main *****/ 12 int main() 13 { 14 int numYears, 15 numChildren; 16 17 cout << “This program can tell your future. \n” 18 << “Enter two integers separated by a space: “; 19 20 cin >> numYears >> numChildren; 21 22 numYears = abs(numYears) % 5; // Convert to a positive integer 0 to 4 23 numChildren = abs(numChildren) % 6; // Convert to a positive integer 0 to 5 24 25 cout << “\nYou will be married in ” << numYears << ” years ” 26 << “and will have ” << numChildren << ” children.\n”; 27 28 return 0; 29 } 30 31 /***** tellFortune *****/ 32 // WRITE THE tellFortune FUNCTION HEADER HERE.

33 // WRITE THE BODY OF THE tellFortune FUNCTION HERE.

Step 2: Run the program to see how it works. What output do you get when you input the following values at the prompt? -99 14

________________________________________________________________________________

Step 3: Create a function that contains the fortune telling part of the code by doing the following:

· On line 9 write the prototype for a void function named tellFortune that has two integer parameters.

· On line 32 write the function header for the tellFortune function. Following that should be the body of the function. Move lines 22 – 26 of the program to the function body.

· Replace current lines 22 – 26 of main with a call to the tellFortune function that passes it two arguments, numYears and numChildren.

Step 4: Recompile and rerun the program. Enter -99 and 14 again. It should work the same as before.

Step 5: If your professor asks you to do so, print the revised source code and the output of executing it several times, using a variety of inputs.

LAB 9.3 – Modularizing a Program with void Functions

Step 1: Please see a copy of the completed areas2.cpp program and place it in your Lab6 folder. Name it areas3.cpp

// Lab 5 areas2-KEY.cpp

// This menu-driven program finds areas of squares,

// circles, and right triangles.

// It modifies the Lab 4 areas.cpp program to use a do-while loop.

// STUDENT NAME GOES HERE.

#include <iostream>

using namespace std;

int main()

{

const double PI = 3.14159;

double side, // Length of a side of a square

radius, // Radius of a circle

base, // Length of base of a right triangle

height, // Height of a right triangle

area; // Area of a square, circle, or right triangle.

int choice; // User’s menu choice

do

{

// Display the menu

cout << “\n\nProgram to calculate areas of different objects \n\n”;

cout << ” 1 — square \n”

<< ” 2 — circle \n”

<< ” 3 — right triangle \n”

<< ” 4 — quit \n\n”;

cin >> choice;

// Find and display the area of the user’s chosen object

if (choice == 1) // square

{ cout << “Length of the square’s side: “;

cin >> side;

area = side * side;

cout << “Area = ” << area << endl;

}

else if (choice == 2) // circle

{ cout << “Radius of the circle: “;

cin >> radius;

area = PI * radius * radius;

cout << “Area = ” << area << endl;

}

else if (choice == 3) // right triangle

{ cout << “Base of the triangle: “;

cin >> base;

cout << “Height of the triangle: “;

cin >> height;

area = .5 * base * height;

cout << “Area = ” << area << endl;

}

else if (choice != 4)

cout << “Choice must be 1, 2, 3, or 4.\n”;

} while (choice != 4);

return 0;

}

Step 2: Remove fortunes.cpp from the project and add the areas3.cpp program to the project.

Step 3: Modularize the program by adding the following 4 functions. None of them have any parameters.

· void displayMenu()

· void findSquareArea()

· void findCircleArea()

· void findTriangleArea()

To do that you will need to carry out the following steps:

· Write prototypes for the four functions and place them above main.

· Write function definitions (consisting of a function header and initially empty body) for the four functions and place them below main.

· Move the appropriate code out of main and into the body of each function.

· Move variable definitions in main for variables no longer in main to whatever functions now use those variables. They will be local variables in those functions. For example, findSquareArea will need to define the side variable and findCircleArea will need to define the radius variable. All of the functions that compute areas will now need to define a variable named area.

· Move the definition for the named constant PI out of main and place it above the main function.

· In main, replace each block of removed code with a function call to the function now containing that block of code.

Step 4: Compile the code, fixing any errors until it compiles without errors. Then test it. Make sure it runs correctly for all menu choices.

Step 5: If your professor asks you to do so, print the revised source code and the output of executing it , selecting each menu choice at least once.

LAB 9.4 – Using a Function that Returns a Value

Step 1: Remove areas3.cpp from the project and add the choice.cpp program in your Lab6 folder to the project. Below is a copy of the source code.

1 // Lab 6 choice.cpp 2 // This program illustrates how to use a value-returning 3 // function to get, validate, and return input data. 4 // PUT YOUR NAME HERE. 5 #include <iostream> 6 #include <cmath> 7 using namespace std; 8 9 // Function prototype 10 int getChoice(); 11 12 /***** main *****/ 13 int main() 14 { 15 int choice; 16 17 cout << “Enter an integer between 1 and 4: “; 18 19 // WRITE A LINE OF CODE TO CALL THE getChoice FUNCTION AND TO 20 // ASSIGN THE VALUE IT RETURNS TO THE choice VARIABLE. 21 22 cout << “You entered ” << choice << endl; 23 } 24 25 /***** getChoice *****/ 26 int getChoice() 27 { 28 int input; 29 30 // Get and validate the input 31 cin >> input; 32 while (input < 1 || input > 4) 33 { cout << “Invalid input. Enter an integer between 1 and 4: “; 34 cin >> input; 35 } 36 return input; 37 }

Step 2: Read through the code to see how it works. Notice that the getChoice function validates the input before returning it.

Step 3: Follow the directions given in the uppercase comments on lines 4 and 19-20. Then compile and run the program. When prompted for an input, use the data shown in the sample run below. You should get the same results.

Sample Run

Enter an integer between 1 and 4: 0

Invalid input. Enter an integer between 1 and 4: 9

Invalid input. Enter an integer between 1 and 4: 2

You entered 2

Step 4: Now make the getChoice function more versatile so it can validate that a choice is in any desired range, not just 1 – 4. Do this by carrying out the following steps:

· Add two integer parameters named min and max to the function header and modify the function prototype to agree with this.

· Revise the function so that it now validates that the input is between min and max. Remember to change the error prompt as well as the test condition of the while loop.

· Revise the line of code in main that calls the function so that it now passes two arguments to the function. Pass the values 1 and 4 to the function (though other values would work also).

Now recompile and rerun the program, again using the data from the sample run shown above. The program should produce the same results as it did before.

Step 5: If your professor asks you to do so, print the revised source code and the output of executing it with the sample run data.

Lab 9.5 – Modularizing a Program with Value-Returning Functions

For this lab exercise you will make additional improvements to the areas program you worked on in Lab 4, Lab 5, and earlier in this lab.

Step 1: In your Lab6 folder make a copy of your areas3.cpp file. Name it areas4.cpp

Step 2: Remove choice.cpp from the project and add the areas4.cpp program to the project.

Step 3: Copy the getChoice function you just wrote in the choice.cpp file for the Lab 6.4 exercise and paste it below the displayMenu function definition in the areas4.cpp file. Add a function prototype for the getChoice function at the top of the program where the other prototypes are located. Now, change the following line of code in main

cin >> choice;

to

choice = getChoice(1, 4);

This will ensure that choice is assigned a value between 1 and 4. Therefore the final else if can be removed from the if/else if statement that controls the branching. After doing this, test the program to make sure everything works so far, before going on to the next step.

Step 4: Now, make the findSquareArea, findCircleArea, and findTriangleArea functions into value-returning functions. They should each return a double value. Change their function headers and function prototypes to indicate this. Then, instead of having them print the area, have them return the area they have computed. Finally, change the call to each of these functions in main so that the value returned by the function call will be printed. For example, you will change

if (choice == 1)

findSquareArea();

to

if (choice == 1)

cout << “Area = ” << findSquareArea() << endl;

Step 5: Compile the code, fixing any errors until it compiles without errors. Then test it. Make sure it runs correctly for all menu choices.

Step 6: If your professor asks you to do so, print the revised source code and the output of executing it , selecting each menu choice at least once.

Lab 9.6 – Using Value and Reference Parameters

Step 1: Remove areas4.cpp from the project and add the swapNums.cpp program in your Lab6 folder to the project. Below is a copy of the source code.

1 // Lab 6 swapNums.cpp — Using Value and Reference Parameters 2 // This program uses a function to swap the values in two variables. 3 // PUT YOUR NAME HERE. 4 #include <iostream> 5 using namespace std; 6 7 // Function prototype 8 void swapNums(int, int); 9 10 /***** main *****/ 11 int main() 12 { 13 int num1 = 5, 14 num2 = 7; 15 16 // Print the two variable values 17 cout << “In main the two numbers are ” 18 << num1 << ” and ” << num2 << endl; 19 20 // Call a function to swap the values stored 21 // in the two variables 22 swapNums(num1, num2); 23 24 // Print the same two variable values again 25 cout << “Back in main again the two numbers are ” 26 << num1 << ” and ” << num2 << endl; 27 28 return 0; 29 } 30 31 /***** swapNums *****/ 32 void swapNums(int a, int b) 33 { // Parameter a receives num1 and parameter b receives num2 34 // Swap the values that came into parameters a and b 35 int temp = a; 36 a = b; 37 b = temp; 38 39 // Print the swapped values 40 cout << “In swapNums, after swapping, the two numbers are ” 41 << a << ” and ” << b << endl; 42 }

Step 2: Read the source code, paying special attention to the swapNums parameters. When the program is run do you think it will correctly swap the two numbers? Compile and run the program to find out.

Explain what happened. _________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

Step 3: Change the two swapNums parameters to be reference variables. Section 6.13 of your text shows how to do this. You will need to make the change on both the function header and the function prototype. Nothing will need to change in the function call. After making this change, recompile and rerun the program. If you have done this correctly, you should get the following output.

In main the two numbers are 5 and 7

In swapNums, after swapping, the two numbers are 7 and 5

Back in main again the two numbers are 7 and 5

Explain what happened this time. _________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

You do not need to hand in the source code or output from this lab exercise.

Lab 9.7 – Complete Program

Step 1: Remove swapNums.cpp from the project and add the kiloConverter.cpp program in your Lab6 folder to the project. This file contains just a program shell in which you will write the programming statements needed to complete the program described below. Here is a copy of the file.

1 // Lab 6 kiloConverter.cpp 2 // This menu-driven program lets the user convert 3 // pounds to kilograms and kilograms to pounds. 4 // PUT YOUR NAME HERE. 5 #include <iostream> 6 using namespace std; 7 8 // Function prototypes 9 // WRITE PROTOTYPES FOR THE displayMenu, getChoice, 10 // kilosToPounds and poundsToKilos FUNCTIONS HERE. 11 12 /***** main *****/ 13 int main() 14 { 15 // DECLARE ANY VARIABLES MAIN USES HERE. 16 17 // WRITE THE CODE HERE TO CARRY OUT THE STEPS 18 // REQUIRED BY THE PROGRAM SPECIFICATIONS. 19 20 return 0; 21 } 22 23 /***** displayMenu *****/ 24 // WRITE THE displayMenu FUNCTION HERE. 25 // THIS void FUNCTION DISPLAYS THE MENU CHOICES 26 // 1. Convert kilograms to pounds 27 // 2. Convert pounds to kilograms 28 // 3. Quit 29 30 /***** getChoice *****/ 31 // THIS IS THE SAME FUNCTION YOU WROTE EARLIER IN THIS SET 32 // OF LAB EXERCISES. JUST FIND IT AND PASTE IT HERE. 33 34 /***** kilosToPounds *****/ 35 // WRITE THE kilosToPounds FUNCTION HERE. 36 // IT RECEIVES A WEIGHT IN KILOS AND MUST CALCULATE 37 // AND RETURN THE EQUIVALENT NUMBER OF POUNDS. 38 39 /***** poundsToKilos *****/ 40 // WRITE THE poundsToKilos FUNCTION HERE. 41 // IT RECEIVES A WEIGHT IN POUNDS AND MUST CALCULATE 42 // AND RETURN THE EQUIVALENT NUMBER OF KILOS.

Step 2: Design and implement a modular, menu-driven program that converts kilograms to pounds and pounds to kilograms. 1 kilogram = 2.2 pounds. The program should display a menu, accept and validate a user menu choice, get the amount of weight to be converted, call the appropriate function to do the conversion, and then print the returned result. The code should continue iterating to allow additional conversions to be done until the user enters the menu choice to quit. When the program runs it should look somewhat like the sample run shown here.

Sample Run

1. Convert kilograms to pounds

2. Convert pounds to kilograms

3. Quit

1

Weight to be converted: 4

4 kilograms = 8.8 pounds.

1. Convert kilograms to pounds

2. Convert pounds to kilograms

3. Quit

2

Weight to be converted: 10

10 pounds = 4.54545 kilograms.

1. Convert kilograms to pounds

2. Convert pounds to kilograms

3. Quit

3

Step 3: Once your program is written and compiles with no errors, thoroughly test it.

Step 4: If your professor asks you to do so, print the completed source code and the output produced by executing it , selecting each menu choice at least once.

2

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Computer Science homework help

Computer Science homework help

10

 

WEEK 5 Assignments

 

Part I – p 48 Introduction

 

Personal

1. Shopping for Software. You are shopping for software that will assist you with your home’s interior design. The package for the program you would like to purchase states that it was designed for the most recent version of Windows, but an older version is installed on your computer. How can you determine whether the program will run on your computer?

Well, to make that program run, it sounds like all you need to do is uninstall the older version that is on your computer already and then install the newer version. As for how to determine which programs will run on your computer, you just need to see what operating system it was designed for and how much RAM it needs to run (and check to make sure your system has that much or more)

 

 

 

2. Bad Directions. You are driving to your friend’s house and are using your smartphone for directions. While approaching your destination, you realize that your smartphone app instructed you to turn the wrong way on your friend’s street. How could this have happened?

How could this happened?

– internet

(routing the wrong way on the

highway or down a closed road).

 

– wrong applications

Solutions?

Why smartphone app instructed me to turn the wrong way?

– because we as a user we need to efficently choose the right application for the right directions.

bad directions??

– we need a basic understanding

how GPS works

– before we install the apps

we should to see the rating or

feedback

 

3. Bank Account Postings. While reviewing your checking account balance online, you notice that debit card purchases have not posted to your account for the past several days. Because you use online banking to balance your account, you become concerned about your unknown account balance. What steps will you take to correct this situation?

You would finally create a check register. Contact online service to check a misuse of my account and update the docs

4. Trial Expired. You have been using an app on your mobile device for a30-day trial period. Now that the 30 days have expired, the app is requesting that you to pay to continue accessing your data. What are your next steps? What steps could you have taken to preserve your data before the trial period expired?

 

 

5. Problematic Camera. After charging your digital camera battery overnight, you insert the battery and turn on the camera only to find that it is reporting a low battery. Seconds later, the camera shuts off automatically. What might be wrong?

 

Professional

6. Discarding Old Computer Equipment. Your company has given you a new laptop to replace your current, outdated desktop. Because of the negative environmental impact of discarding the old computer in the trash, your supervisor asked you to suggest options for its disposal. How will you respond?

 

 

7. Dead Battery. While traveling for business, you realize that you forgot to bring the battery charger for your laptop. Knowing that you need to use the laptop to give a presentation tomorrow, what steps will you take tonight to make sure you have enough battery power?

 

8. Cannot Share Photos. You are attempting to send photos of a house for sale in an email message to your real estate partner. Each time you attempt to send the email message, you receive an automatic response stating that the files are too large. What are your next steps?

 

 

9. Incorrect Sign-In Credentials. Upon returning to the office from a well-deserved two-week vacation, you turn on your computer. When you enter your user name and password, an error message appears stating that your password is incorrect. What are your next steps?

 

10. Synchronization Error. You added appointments to the calendar on your computer, but these appointments are not synchronizing with your smartphone. Your calendar has synchronized with your smartphone in the past, but it has stopped working without explanation. What are your next steps?

 

 

 

Part II – p 100 Connection and Communication Online

 

Personal

1. Cyberbullying. Message While reviewing the email messages in your email account, you notice one that you interpret as cyberbullying. You do not recognize the sender of the email message, but still take it seriously. What are your next steps?

 

2. Unsolicited Friend Requests. You recently signed up for an account on the Facebook online social network. When you log in periodically, you find that people you do not know are requesting to be your friend. How should you respond?

 

 

3. Unexpected Search Engine. A class project requires that you conduct research on the web. After typing the web address for Google’s home page and pressing the enter key, your browser redirects you to a different search engine. What could be wrong?

 

4. Images Do Not Appear. When you navigate to a webpage, you notice that no images are appearing. You successfully have viewed webpages with images in the past and are not sure why images suddenly are not appearing. What steps will you take to show the images?

 

 

5. Social Media Password. Your social media password has been saved on your computer for quite some time and the browser has been signing you in automatically. After deleting your browsing history and saved information from your browser, the online social network began prompting you again for your password, which you have forgotten. What are your next steps?

 

Professional

6. Suspicious Website Visits. The director of your company’s information technology department sent you an email message stating that you have been spending an excessive amount of time viewing websites not related to your job. You periodically visit websites not related to work, but only on breaks, which the company allows. How does he know your web browsing habits? How will you respond to this claim?

 

 

7. Automatic Response. When you return from vacation, a colleague informs you that when she sent email messages to your email address, she would not always receive your automatic response stating that you were out of the office. Why might your email program not respond automatically to every email message received?

 

8. Email Message Formatting. A friend sent an email message containing a photo to your email account at work. Upon receiving the email message, the photo does not appear. You also notice that email messages never show any formatting, such as different fonts, font sizes, and font colors. What might be causing this?

 

 

9. Mobile Hot Spot Not Found. Your supervisor gave you a mobile hot spot to use while you are traveling to a conference in another state. When you attempt to connect to the hot spot with your computer, tablet, and phone, none of the devices is able to find any wireless networks. What might be the problem, and what are your next steps?

 

10. Sporadic Email Message Delivery. The email program on your computer has been displaying new messages only every hour, on the hour. Historically, new email messages would arrive and be displayed immediately upon being sent by the sender. Furthermore, your coworkers claim that they sometimes do not receive your email messages until hours after you send them. What might be the problem?

 

 

 

 

Part III – p 150 Computer and Mobile Devices

 

Personal

1. Slow Computer Performance. Your computer is running exceptionally slow. Not only does it take the operating system a long time to start, but programs also are not performing as well as they used to perform. How might you resolve this?

 

2. Faulty ATM. When using an ATM to deposit a check, the ATM misreads the amount of the check and credits your account the incorrect amount. What can you do to resolve this?

 

3. Wearable Device Not Synchronizing. Your wearable device synchronized with your smartphone this morning when you turned it on, but the two devices no longer are synchronized. What might be wrong, and what are your next steps?

 

4. Battery Draining Quickly. Although the battery on your smartphone is fully charged, it drains quickly. In some instances when the phone shows that the battery has 30 remaining, it shuts down immediately. What might be wrong?

 

5. Potential Virus Infection. While using your laptop, a message is displayed stating that your computer is infected with a virus and you should tap or click a link to download a program designed to remove the virus. How will you respond?

 

Professional

6. Excessive Phone Heat. While using your smartphone, you notice that throughout the day it gets extremely hot, making it difficult to hold up to your ear. What steps can you take to correct this problem?

 

7. Server Not Connecting. While traveling on a business trip, your phone suddenly stops synchronizing your email messages, calendar information, and contacts. Upon further investigation, you notice an error message stating that your phone is unable to connect to the server. What are your next steps?

 

8. Mobile Device Synchronization. When you plug your smartphone into your computer to synchronize the data, the computer does not recognize that the smartphone is connected. What might be the problem?

 

9. Cloud Service Provider. Your company uses a cloud service provider to back up the data on each employee’s computer. Your computer recently crashed, and you need to obtain the backup data to restore to your computer; however, you are unable to connect to the cloud service provider’s website. What are your next steps?

 

10. Connecting to a Projector. Your boss asked you to give a presentation to your company’s board of directors. When you enter the boardroom and attempt to connect your laptop to the projector, you realize that the cable to connect your laptop to the projector does not fit in any of the ports on your laptop. What are your next steps?

 

 

Part IV – p 204 Programs and Apps

 

Personal

1. Antivirus Program Not Updating. You are attempting to update your antivirus program with the latest virus definitions, but you receive an error message. What steps will you take to resolve this issue?

 

2. Operating System Does Not. Load Each time you turn on your computer, the operating system attempts to load for approximately 30 seconds and then the computer restarts. You have tried multiple times to turn your computer off and on, but it keeps restarting when the operating system is trying to load. What are your next steps?

 

3. Unwanted Programs. When you displayed a list of programs installed on your computer so that you could uninstall one, you noticed several installed programs that you do not remember installing. Why might these programs be on your computer?

 

4. News Not Updating. Each morning, you run an app on your smartphone to view the news for the current day. For the past week, however, you notice that the news displayed in the app is out of date. In fact, the app now is displaying news that is nearly one week old. Why might the app not be updating? What are your next steps?

 

5. Incompatible App. You are using your Android tablet to browse for apps in the Google Play store. You found an app you want to download, but you are unable to download it because a message states it is incompatible with your device. Why might the app be incompatible with your device?

 

Professional

6. Videoconference Freezes. While conducting a videoconference with colleagues around the country, the audio sporadically cuts out and the video freezes. You have attempted several times to terminate and then reestablish the connection, but the same problem continues to occur. What might be the problem?

 

7. License Agreement. You are planning to work from home for several days, but you are unsure of whether you are allowed to install a program you use at work on your home computer. What steps will you take to determine whether you are allowed to install the software on your home computer?

 

8. Low on Space. The computer in your office is running low on free space. You have attempted to remove as many files as possible, but the remaining programs and files are necessary to perform your daily job functions. What steps might you take to free enough space on the computer?

 

9. Unacceptable File Size. Your boss has asked you to design a new company logo using a graphics application installed on your computer. When you save the logo and send it to your boss, she responds that the file size is too large and tells you to find a way to decrease the file size. What might you do to make the image file size smaller?

 

10. Disc Burning Not Working. While attempting to back up some files on your computer on an optical disc, the disc burning software on your computer reports a problem and ejects the disc. When you check the contents of the disc, the files you are trying to back up are not there. What might be wrong?

 

 

Part V – p 254 Digital Security, Ethics and Privacy

 

1. Define the terms, digital security risk, computer crime, cybercrime, and crime ware.

2. Differentiate among hackers, crackers, script kiddies, cyber extortionists, and cyberterrorists. Identify issues with punishing cybercriminals.

 

3. List common types of malware. A(n) ___ is the destructive event or prank malware delivers.

 

4. Identify risks and safety measures when gaming.

 

5. Define these terms: botnet, zombie, and bot.

 

6. Describe the damages caused by and possible motivations behind DoS and DDoS attacks.

 

7. A(n) ___ allows users to bypass security controls when accessing a program, computer, or network.

 

8. Define the term, spoofing. How can you tell if an email is spoofed?

 

9. List ways to protect against Internet and network attacks.

 

10. Describe the purpose of an online security service.

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Business Computer Application Assessment

Business Computer Application Assessment

SIMnet 2016: PowerPoint, Word, Excel Integrated Project 3

1 | P a g e Last Modified: 8/8/17

Office 2016 Integrated Applications – Project 3 Creating a Company’s Presentation In this project, you will create a presentation for the Top’t Corn popcorn company using resources from a Word document

and an Excel file. First, you will format an outline in Word so it can be imported as slides and content for the presentation.

You will format the look of the text before and after importing and use Format Painter to copy and paste formatting between

slides. Next, work with data in Excel, adding formulas and creating a table and a chart. Finally, you will copy and paste the

chart and table data from Excel into your PowerPoint presentation.

Skills needed to complete this project:

Word Skills

• Apply heading styles

• Change the color theme

PowerPoint Skills

• Import slides from a Word outline

• Change the font

• Align text

• Use Format Painter

• Change slide layout

• Add a table to a slide

• Paste data from Excel

• Change font color

• Paste a chart from Excel

• Move an object on a slide

Excel Skills

• Enter text and numbers in cells

• Create a formula using multiplication

• Use an absolute reference in a formula

• Copy a formula

• Format data as a table

• Sort data in a table

• Use the AVERAGE function in a formula

• Use the SUM function in a formula

• Apply a number format

• Modify the font size

• Autofit columns

• Create a PivotTable using a Recommended PivotTable

• Create a pie chart

• Hide the chart title

• Apply a chart style

IMPORTANT: Download the resource file needed for this project from the Resources link. Be sure to extract the file after downloading the resources zipped folder. Please visit SIMnet Instant Help for step-by- step instructions.

1. Open the start file OF2016-Integrated-Project3. If the document opens in Protected View, click the

Enable Editing button in the Message Bar at the top of the document so you can modify it.

2. The file will be renamed automatically to include your name. Change the project file name if directed to

do so by your instructor, and save it.

3. Open the Top’t Corn Outline Word document from the location where you saved the data files

for this project. (Downloaded from the Resources link.)

a. Apply the Heading 1 style to numbered items in the list.

b. Apply the Heading 2 style to the lettered items in the list.

c. Change the color theme of the document to Red Orange

d. Save the document with the name Top’t Corn Outline for Import. Close the document.

e. Return to the PowerPoint presentation you downloaded from SIMnet.

 

Step 1

Download start file

Download Resources

 

 

SIMnet 2016: PowerPoint, Word, Excel Integrated Project 3

2 | P a g e Last Modified: 8/8/17

4. Import the Top’t Corn Outline for Import Word file into OF2016-Integrated-Project3 presentation.

a. Use Slides from Outline… option to import the Top’t Corn Outline for Import file.

Note: When you are finished with this step, your presentation should contain 10 slides. If it does

not, your project will not grade properly and you may lose a significant number of points. Check

your work carefully.

b. Verify that the Heading 1 style items from the Word file appear as the titles, Heading 2 style items

appear in the body.

c. Verify that the title font on the imported slides appears to be an Red Orange color.

d. Select the title placeholder on Slide 2 (the placeholder with the word Overview). Change the font to

Calibri and left align the text.

e. With the title placeholder still selected, use Format Painter to copy the formatting and paste the

formatting each of the title placeholders on Slides 3 through 10.

5. Open the OldBayMDSales Excel file (downloaded from the Resources link) and create a table to copy

into PowerPoint.

a. Go to the OldBaySales worksheet. In cell C1, type: Total Sale

b. In cell E1, type: Price

c. In cell F1, type: $9.00

d. In cell C2, enter a formula to calculate the total sale. Multiple the quantity sold (cell B2) by the price

per box (cell F1). You are going to copy this formula to cells C3:C9, so use relative and absolute

references as appropriate.

e. Copy the formula in cell C2 to cells C3:C9.

f. Format the data in cells A1:C9 as a table using any style.

g. Sort the table data by values in the quantity column so the largest number is at the top.

h. In cell E3, type: Average Quantity

i. Enter a formula in cell F3 to calculate the average of cells B2:B9.

j. In cell E4, type: Total Sales

k. Enter a formula in cell F4 to calculate the sum of cells C2:C9.

l. Apply the Currency number format to cell F4.

m. Select cells A1:F9 and change the font size to 18.

n. Autofit all columns so the data are completely visible.

o. Copy cells A1:F9.

p. Save the Excel file, but leave it open.

Download Resources

 

 

SIMnet 2016: PowerPoint, Word, Excel Integrated Project 3

3 | P a g e Last Modified: 8/8/17

6. Return to the PowerPoint presentation and navigate to Slide 8.

a. Change the layout for Slide 8 to Title and Content.

b. Add a table to the slide with six columns and nine rows.

c. Paste the data you copied from Excel into the table, and select Use Destination Style paste option.

d. Where necessary, change the text in the header row to bold, White, Background 1 (the first color

in the first row of theme colors).

e. Save the PowerPoint presentation, but do not exit PowerPoint yet.

7. Return to the OldBayMDSales Excel file and create a chart from the data in the TruffleSales worksheet.

a. Create a PivotTable from the data in the TruffleSales worksheet. Use the first (only) recommended

PivotTable – Sum of Quantity by State.

b. Create a 2-D pie PivotChart from the PivotTable data.

c. Hide the chart title.

d. Apply the chart Quick Style Style 11.

e. Copy the chart.

f. Save and close the Excel file.

8. Return to the PowerPoint presentation and navigate to Slide 9.

a. Change the layout for Slide 9 to Title Only.

b. Paste the chart you copied from Excel into the slide. Use the Keep Source Formatting & Embed

Workbook paste option.

c. Drag the chart down so it is positioned in the middle of the slide.

d. Save and close the presentation.

9. Upload and save your project file.

10. Submit project for grading. Step 2 Upload & Save

Step 3

Grade my Project

 

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

Computer Science homework help

Computer Science homework help

New Perspectives Word 2016 | Module 2: SAM Project 1a

 

C:\Users\akellerbee\Documents\SAM Development\Design\Pictures\g11731.pngNew Perspectives Word 2016 | Module 2: SAM Project 1a

Transportation Technology Report

preparing a research paper

GETTING STARTED

Open the file NP_WD16_2a_FirstLastName_1.docx, available for download from the SAM website.

Save the file as NP_WD16_2a_FirstLastName_2.docx by changing the “1” to a “2”.

0. If you do not see the .docx file extension in the Save As dialog box, do not type it. The program will add the file extension for you automatically.

With the file NP_WD16_2a_FirstLastName_2.docx still open, ensure that your first and last name is displayed in the footer.

· If the footer does not display your name, delete the file and download a new copy from the SAM website.

 

PROJECT STEPS

For your Emerging Technology class, you are part of a group writing a research paper on new transportation technologies. Your paper is about self-driving cars and must follow the MLA format. Change the Citation & Bibliography Style of the document to MLA.

Apply the Capitalize Each Word case to the title paragraph “Future transportation technology: self-driving cars”.

Insert a header to meet MLA standards as follows:

a. From the Top of Page page number gallery, insert a Plain Number 3 page number to the header of all pages in the document.

b. Without moving your insertion point, type Cooper and then press the Spacebar.

c. Close the Header & Footer Tools.

Find the word “machine” and replace all instances with the word computer. (Hint: Do not include the period. You should find and replace four instances.)

Create a First Line Indent of 0.5″ to indent the first lines of all the body paragraphs beginning “In California and Nevada…” and ending “…vehicle owners enjoy the benefits.”

Move the second body paragraph beginning “A self-driving car…” so that it becomes the new first body paragraph.

Find the paragraph beginning “Three technologies are required….” Move the insertion point before the colon and insert a citation from a new source using the information shown in Table 1 on the next page.

Table 1: Periodical Source

 

 

Type of Source Article in a Periodical
Author Pullen, John Patrick
Title Driverless Cars
Periodical Title Time Magazine
Year 2015
Month February
Day 24
Pages 35-39
Medium Print

 

 

Edit the new Pullen citation to add 37 as the page number.

Create a numbered list from the paragraphs beginning with “Global positioning system (GPS) – A high-definition GPS…” and ending with “…from the other two systems.”

In the paragraph beginning “The third major advantage…”, read the comment from Abby Markham and then reply to it with the text:

Thanks, this looks great.

In the same paragraph, move the insertion point before the period in the sentence “The idea behind platooning…according to an article in Science News.” Insert a citation that creates a new source with the information shown in Table 2 below.

 

Table 2: Journal Source

 

 

Type of Source Journal Article
Author Wu, Karen
Title Look Ma, No Hands!
Journal Name Science News
Year 1997
Pages 162-175
Medium Print

 

 

 

In the paragraph beginning “The substantial benefits…”, respond to the comment as follows:

d. Read the comment and then delete it.

e. Change the text “$50,000” to $100,000 in the middle of the paragraph.

Move the insertion point before the period in the sentence you modified in the previous step (“The cost of the new technology…for most car owners.”), and then insert a citation to the existing Fagnant, Daniel and Kockelman, Kara source.

Edit the new Fagnant citation to add 9 as the page number.

Move the insertion point to the end of the document, and then insert a bibliography as follows:

f. Insert a page break.

g. Insert a Works Cited from the Bibliography gallery.

You notice an error in the Fagnant source. Edit the Fagnant source so that the Name of Web Page reads “Preparing for a Nation of Autonomous Vehicles”.

Update the Works Cited list to reflect the edit you made to the source.

Format the “Works Cited” heading as follows:

h. Apply the Normal style to the heading.

i. Center the heading.

Select the entire document and format it as follows:

j. Change the font size to 12 pt.

k. Change the line spacing to double.

Move the insertion point to the beginning of the document, and then insert a comment with the following text:

Please review the format of the document.

Check the Spelling & Grammar in the document to identify and correct any spelling errors. (Hint: Ignore proper names. You should find and correct at least one spelling error.)

Your document should look like the Final Figure on the following pages. Save your changes, close the document, and then exit Word. Follow the directions on the SAM website to submit your completed project.

Final Figure

  

2
 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!

CSE205 Object Oriented Programming And Data Structures Homework 1 :: 25 Pts assignment Help

CSE205 Object Oriented Programming And Data Structures Homework 1 :: 25 Pts assignment Help

CSE205 Object Oriented Programming and Data Structures Homework 1 :: 25 pts
1 Submission Instructions
Create a document using your favorite word processor and type your exercise solutions. At the top of the document be
sure to include your name and the homework assignment number, e.g. HW1. Convert this document into Adobe PDF
format and name the PDF file <asuriteid>.pdf where <asuriteid> is your ASURITE user id (for example, my ASURITE
user id is kburger2 so my file would be named kburger2.pdf). To convert your document into PDF format, Microsoft Office
versions 2008 and newer will export the document into PDF format by selecting the proper menu item from the File
menu. The same is true of Open Office and Libre Office. Otherwise, you may use a freeware PDF converter program, e.g.,
CutePDF is one such program.
Next, create a folder named <asuriteid> and copy <asuriteid>.pdf to that folder. Copy any Java source code files to this
folder (note: Java source code files are the files with a .java file name extension; do not copy the .class files as we do not
need those).
Next, compress the <asuriteid> folder creating a zip archive file named <asuriteid>.zip. Upload <asuriteid>.zip to the
Homework Assignment 1 dropbox by the assignment deadline. The deadline is 11:59pm Wed 26 Mar. Consult the online
syllabus for the late and academic integrity policies.
Note: not all of these exercises will be graded, i.e., random ones will be selected for grading.
2 Learning Objectives
1. Use the Integer and Double wrapper classes.
2. Declare and use ArrayList class objects.
3. Write code to read from, and write to, text files.
4. Write an exception handler for an I/O exception.
5. Write Java classes and instantiate objects of those classes.
6. Read UML class diagrams and convert the diagram into Java classes.
7. Identify and implement dependency, aggregation, inheritance, and composition relationships.
3 ArrayLists
3.1 Write code that creates an ArrayList<Integer> object named list and fills list with these numbers (using one or a
pair of for or while loops):
0 1 2 3 4 0 1 2 3 4
3.2 Consider the ArrayList<Integer> object named list containing these Integers:
list = { 1, 2, 3, 4, 5, 4, 3, 2, 1, 0 }
What are the contents of list after this loop completes?
for (int i = 1; i < 10; ++i) {
list.set(i, list.get(i) + list.get(i-1));
}
3.3 Write an enhanced for loop that counts how many numbers in an ArrayList<Integer> object named list are negative.
Print the count after the loop terminates.
3.4 Write a method named arrayListSum() that has one parameter pList which is an object of the class ArrayList
<Integer>. The method shall return the sum of the elements of pList.
3.5 Write a method named named arrayListCreate() that has two int parameters pLen and pInitValue. The method
shall create and return a new ArrayList<Integer> object which has exactly pLen elements. Each element shall be
initialized to pInitValue.
Arizona State University Page 1
CSE205 Object Oriented Programming and Data Structures Homework 1 :: 25 pts
3.6 Write a void method named insertName() that has two input parameters: (1) pList which is an object of ArrayList
<String> where each element of pList is a person’s name; and (2) a String object named pName. Assume the names
in pList are sorted into ascending order. The method shall insert pName into pList such that the sort order is
maintained.
3.7 Write a void method named arrayListRemove() which has two parameters: pList is an object of the ArrayList
<Integer> class and pValue is an int. The method shall remove all elements from pList that are equal to pValue.
4 Text File Input/Output
4.1 Explain what happens if you try to open a file for reading that does not exist.
4.2 Explain what happens if you try to open a file for writing that does not exist.
4.3 Name your source code file Hw1_1.java. Write a program that prompts the user for the name of a Java
source code file. The program shall read the source code file and output the contents to a new file named the same
as the input file, but with a .txt file name extension (e.g., if the input file is foo.java then the output file shall be
named foo.java.txt). Each line of the input file shall be numbered with a line number (formatted as shown below) in
the output file. For example, if the user enters Hw1_1.java as the name of the input file and Hw1_1.java contains:
//***************************************************************
// CLASS: Hw1_1 (Hw1_1.java)
//***************************************************************
public class Hw1_1 {
public static void main(String[] pArgs) {
}
public Hw1_1() {
}
}
then the contents of the output file Hw1_1.java.txt would be:
[001] //***************************************************************
[002] // CLASS: Hw1_1 (Hw1_1.java)
[003] //***************************************************************
[004] public class Hw1_1 {
[005] public static void main(String[] pArgs) {
[006] }
[007] public Hw1_1() {
[008] }
[009] }
Hint: to print an integer as shown above in a field of width 3 with leading 0’s use the printf() method with a format
specifier of %03d.
5 Exceptions and Exception Handling
5.1 Explain the difference between throwing an exception and catching an exception, i.e., explain what happens when an
exception is thrown and when one is caught?
5.2 Explain what a checked exception is. Give one example.
5.3 Explain what an unchecked exception is. Give one example.
5.4 Which type of uncaught exceptions must be declared with the throws reserved word in a method header?
5.5 Why don’t you need to declare that your method might throw an IndexOutOfBoundsException?
Arizona State University Page 2
CSE205 Object Oriented Programming and Data Structures Homework 1 :: 25 pts
5.6 Is the type of the exception object always the same as the type declared in the catch clause that catches it? If not,
why not?
5.7 What is the purpose of the finally clause? Give an example of how it can be used.
5.8 Which exceptions can the next() and nextInt() methods of the Scanner class throw? Are they checked exceptions or
unchecked exceptions?
6 Objects and Classes
6.1 Explain how an instance method differs from a class method (static method).
6.2 Explain what happens if we write a class named C but do not implement any constructors in C.
6.3 (a) In a static method, it is easy to differentiate between calls to instance methods and calls to static methods. How
do you tell them apart? (b) Why is it not as easy for methods that are called from an instance method?
6.4 Explain what happens when this application runs and why.
public class C {
private int x;
private String s;
public static void main(String[] pArgs) {
new C();
}
public C() {
x = s.length();
System.out.println(“x = ” + x);
}
}
6.5 Write the declaration for a class named C that declares: (1) a private int instance variable named mX; (2) a private
int class variable named mY initialized to 0; (3) a private int class constant named A which is equivalent to 100; (4)
a public int class constant named B which is equivalent to 200; (5) public accessor and mutator methods for mX
named getX() and setX(); (6) public accessor and mutator methods for mY named getY() and setY(); (7) a
constructor that has one int input parameter named pX which calls setX() to initialize mX to pX; (8) a default
constructor that calls C(int) to initialize mX to -1.
6.6 Continuing with the previous exercise, write the declaration for a class named Main that implements the main()
method. Within main() suppose we wish to instantiate a C object named cObj1 calling the default constructor.
Write the code to do this.
6.7 Continuing, write the code to instantiate another C object named cObj2 calling the second constructor to initialize
the mX instance variable to 10.
6.8 Continuing, within main(), are the following statements legal, i.e., do they compile? If so, explain what happens
when the statement is executed. If not, explain why the statement is illegal.
(a) int a1 = C.mX;
(b) int a2 = C.mY;
(c) int a3 = C.A;
(d) int a4 = C.B;
(e) cObj1.C(20);
(f) int a5 = cObj1.getX();
(g) cObj1.setX(20);
(h) cObj2.setX(cObj1.getX());
(i) int a6 = C.getX();
(j) C.setX(20);
(k) int a7 = cObj1.getY();
(l) cObj1.setY(20);
(m) int a8 = C.getY();
(n) C.setY(20);
Arizona State University Page 3
CSE205 Object Oriented Programming and Data Structures Homework 1 :: 25 pts
6.9 Continuing, suppose we add these two methods to the declaration of class C. For each assignment statement, if it is
legal (compiles) explain what happens when the statement is executed. For each assignment statement that is illegal
(syntax error) explain why the code is illegal.
public void f() {
mX = 0;
mY = 0;
}
public static void g() {
mX = 0;
mY = 0;
}
7 Object Oriented Design and UML Class Diagrams
7.1 Below is the code for a Java class named C. Draw the UML class diagram that corresponds to this code. There are
several free and open-source tools for drawing UML diagrams. Two reasonably simple and cross-platform (Windows,
Mac, Linux) tools are Umlet (http://www.umlet.com/) and Violet (http://alexdp.free.fr/violetumleditor). I have been
using Umlet for the diagrams I am drawing and I highly recommend it as it is very easy to quickly draw a
nice-looking class diagram. Using Umlet, you can export your diagram as an image file by selecting File | Export
As… on the main menu. I recommend you export the diagram as a .png image and then copy-and paste the .png
image into your word processing document.
public class C {
public static final int CONST1 = 100;
private int mX;
private double mY;
private String mZ;
public C() { this(0, 0, “”); }
public C(int pX, double pY, String pZ) { setX(pX); setY(pY); setZ(pZ); }
public int getX() { return mX; }
public int getY() { return mY; }
private String getZ() { return mZ; }
public void setX(int pX) { mX = pX; }
public void setY(int pY) { mY = pY; }
private void setZ(int pZ) { mZ = pZ; }
}
7.2 On the next page is a UML class diagram that shows several classes that are related in various ways. (a) What type
of class relationship, if any, exists between Course and Roster? If there is a relationship, modify the diagram to
indicate the relationship and label each end of the relationship with a multiplicity. (b) What type of class
relationship, if any, exists between Roster and Student. If there is a relationship, modify the diagram to indicate the
relationship and label each end of the relationship with a multiplicity. (c) What type of class relationship, if any,
exists between Student and UndergradStudent? If there is a relationship, modify the diagram to indicate the
relationship and label each end of the relationship with a multiplicity. (d) What type of class relationship, if any,
exists between Student and GradStudent? If there is a relationship, modify the diagram to indicate the relationship
and label each end of the relationship with a multiplicity. (e) What type of class relationship, if any, exists between
UndergradStudent and GradStudent? If there is a relationship, modify the diagram to indicate the relationship and
label each end of the relationship with a multiplicity.
Note: Draw this diagram in a UML diagramming tool such as Umlet or Violet and copy-and-paste your completed
diagram into your word processing document.
Arizona State University Page 4
CSE205 Object Oriented Programming and Data Structures Homework 1 :: 25 pts
Arizona State University Page 5

 
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!