WRITE IN C++
Create a class named Coord in C++
Class has 3 private data items
int xCoord;
int yCoord;
int zCoord;
write the setters and getters. They should be inline functions
void setXCoord(int) void setYCoord(int) void setZCoord(int)
int getXCoord() int getYCoord() int getZCoord()
write a member function named void display() that displays the data items in the following format
blank line
xCoord is ????????
yCoord is ????????
zCoord is ????????
Blank line
Example
blank line
xCoord is 101
yCoord is -234
zCoord is 10
Blank line
In: Computer Science
could a business use it information technology to increase switching costs and lock in its customers and suppliers? Use business examples to support your answer
In: Computer Science
create a c++ proram to accept a positive number in the main program. Create and call the following functions 1.
1. OddorEven -to determine if the number is an odd or even number ( do not use $ or modul opeartor) and will return " even number " or " odd number ".
2. Factorial - to compute the factorial of N.
3. Power - to compute the power of N without using pow function.
display the result in the main function.
use only #include <iostream>
In: Computer Science
Task 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Consider a disk drive with 2,000 tracks, numbered 0 to 1,999. The request queue has
the following composition: 1045 750 932 878 1365 1787 1245 664 1678 1897
The current position is 1167 and the previous request was served at 1250. For each
of the following disk scheduling algorithms, compute the total distance (in tracks)
that the disk arm would move. Explain how you arrive at your answers.
4.1 First-In-First-Out (FIFO) (2)
4.2 Shortest-Service-Time-First (SSTF) (2)
4.3 SCAN (Without LOOK variation) (2)
4.4 C-SCAN (Without C-LOOK variation) (2)
In: Computer Science
In: Computer Science
In: Computer Science
Case 6: Project Resource Management
Several people working on the Healthy You Intranet Project are
confused about their responsibilities for the testing portion of
the project. Recall that the team members include you, a
programmer/analyst and junior/assistant project manager; Ivan, a
network specialist; Helen, a business analyst; and Bonnie, another
programmer/analyst. Paul Sparks is the project manager, and he has
been working closely with managers in other departments to make
sure everyone knows what’s going on with the project.
The main tasks for testing include writing a test plan, unit
testing and integration testing for each of the main system modules
(registration, tracking, and incentives), system testing, and user
acceptance testing.
In addition to the project team members, a team of user
representatives is available to help with testing, and Paul has
also hired an outside consulting firm ABC Digital to help as
needed.
One of the issues Paul identified is the ability to work
effectively with the user group during testing. According to MBTI
classifications, Paul knows that several of his project team
members are very introverted and strong thinking types, while
several members of the user group are very extroverted and strong
feeling types.
Prepare a responsibility assignment matrix (RAM) based on the
information from this case.
3. Prepare a RACI chart (use the template) to help clarify roles
and responsibilities for these testing tasks. Document key
assumptions you make in preparing the chart.
In: Computer Science
In: Computer Science
What is the basis of nonrepudiation and how is it commonly
implemented? (Please be specific)
In: Computer Science
What does this mean in C++ syntax?
(leftover < 0 ? -leftover : 0)
and
(leftover > 0 ? leftover : 0)
Full version:
// rugfit1.cpp - calculates fit of rug to a floor
#include <iostream>
using namespace std;
// utility function to calculate area of a rectangle
double area(double width, double length) {
return width * length;
}
int main() {
double floorWidth, floorLength, rugWidth, rugLength,
floorArea, rugArea, leftover;
cout << "enter width and length of floor: ";
cin >> floorWidth >> floorLength;
cout << "enter width and length of rug: ";
cin >> rugWidth >> rugLength;
floorArea = area(floorWidth, floorLength);
rugArea = area(rugWidth, rugLength);
leftover = rugArea - floorArea;
cout << "floor area: " << floorArea <<
endl;
cout << "rug area: " << rugArea << endl;
cout << "leftover rug area: " <<
(leftover > 0 ? leftover : 0) << endl;
cout << "empty floor area: " <<
(leftover < 0 ? -leftover : 0) << endl;
return 0;
}
In: Computer Science
Task 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
For this task, you will need to search for related literature to _nd your answer. You
must make use of the LNCS referencing style required here:
https://www:springer:com/gp/computer-science/lncs/conference-proceedings-
guidelines.
Look at the guidelines and the templates for reference examples. Failure to provide citations in LNCS style will result in mark forfeiture. You are also limited to use scientific material and books; websites like Wikipedia and StackOverflow are not considered a credible source.
5.1 What are the next developments that are proposed by researchers in the area (1)
of RAID (not covered in the textbook)? Choose a particular development and
very briefly discuss it. Provide the necessary references for your answer.
In: Computer Science
USE JAVA PLEASE
Use recursion to implement a method
public static int indexOf(String text, String str)
that returns the starting position of the first substring of the
text that matches str.
Return –1 if str is not a substring of the text.
For example, s.indexOf("Mississippi", "sip") returns 6.
Hint: You must keep track of how far the match is from the beginning of the text. Make that value a parameter variable of a helper method.
In: Computer Science
Problem Description:
Write a program that prompts the user to enter a directory and displays the number of the files in the directory.
Analysis:
(Describe the problem including input and output in your own words.)
Design:
(Describe the major steps for solving the problem. How do you use recursion to solve this problem.)
Coding: (Copy and Paste Source Code here. Format your code using Courier 10pts)
Name the public class Exercise18_29
Testing: (Describe how you test this program)
In: Computer Science
I have questions in regards to the following code
1. package Week_5;
2. import java.util.InputMismatchException;
3. import java.util.Scanner;
4. public class Customer {
5. public String firstName;
6. public String lastName;
7. public String FullName()
8. {
9. return this.firstName+" "+this.lastName;
10. }
11. }
12. public class ItemsForSale {
13. public String itemName;
14. public double itemCost;
15. public boolean taxable;
16. public void PopulateItem(String iName, double iCost, boolean canTax)
17. {
18. this.itemName = iName;
19. this.itemCost = iCost;
20. this.taxable = canTax;
21. }
22. }
23. class PRG215_Week_5 {
24. public static void main(String[] args) {
25. final int TOTAL_ITEMS = 6;
26. ItemsForSale[] items = new ItemsForSale[TOTAL_ITEMS];
27. for(int i = 0; i < TOTAL_ITEMS; i++)
28. {
29. items[i] = new ItemsForSale();
30. }
31. items[0].PopulateItem("Tennis Shoes",45.89,true);
32. items[1].PopulateItem("Shits", 25.55, true);
33. items[2].PopulateItem("Coats", 89.99, true);
34. items[3].PopulateItem("Belts", 15, true);
35. items[4].PopulateItem("Pants", 25.99, true);
36. items[5].PopulateItem("Donation", 10, false);
37. double totalAmount = 0.0;
38. double totalTax = 0.0;
39. double taxRate = 0.081;
40. final double DISCOUNT_RATE = 0.025;
41. final double AMOUNT_TO_QUALIFY_FOR_DISCOUNT = 100;
42. double discountAmount = 0;
43. System.out.println("The following clothing items are available for purchase:");
44. for(int i=0; i < items.length; i++)
45. {
46. //Display each item in the array
47. System.out.println(" "+(i + 1)+". "+items[i].itemName+ " for $"+items[i].itemCost+" each");
48. }
49. System.out.println("");
50. Scanner keyboard = new Scanner(System.in);
51. Customer newCust = new Customer();
52. System.out.print("Please enter your first name: ");
53. newCust.firstName = keyboard.next();
54. System.out.print("Please enter your last name: ");
55. newCust.lastName = keyboard.next();
56. System.out.println("");
57. System.out.println("Ok, " + newCust.FullName()+", please enter the product ID (the number to the left of the item name) that you wish to purchase. Enter 0 when you are finished.");
58. int itemID = 0;
59. int itemCounter = 1;
60. do 61. {
62. System.out.print("Please enter item ID number "+(itemCounter)+": ");
63. try
64. {
65. itemID = keyboard.nextInt();
66. if(itemID > 0)
67. {
68. totalAmount = totalAmount + items[itemID - 1].itemCost;
69. if(items[itemID - 1].taxable == true)
70. {
71. totalTax = totalTax + (items[itemID - 1].itemCost * taxRate);
72. }
73. itemCounter++;
74. }
75. }
76. catch (ArrayIndexOutOfBoundsException e1)
77. {
78. System.out.println("The item ID you entered is outside the range of possible items. This must be a number between 1 and "+ TOTAL_ITEMS+". Please re-enter your item ID. ");
79. itemID = -1;
80. }
81. catch (InputMismatchException e2)
82. {
83. //Display the error message
84. System.out.println("The item ID you entered does not appear to be an ingeger number. The item ID must be a number between 1 and "+ TOTAL_ITEMS+". Please re-enter your item ID. ");
85. keyboard.nextLine(); 86. itemID = -1;
87. }
88.
89. } while (itemID != 0); //Check if exit condition has been met
90. if(totalAmount >= AMOUNT_TO_QUALIFY_FOR_DISCOUNT)
91. {
92. discountAmount = totalAmount * DISCOUNT_RATE;
93. }
94. else
95. {
96. discountAmount = 0;
97. }
98. System.out.println("");
99. System.out.println("You selected "+itemCounter+" items to purchase.");
100. System.out.println("Your sales total $"+totalAmount);
101. System.out.println("Your discount amount is $"+discountAmount);
102. System.out.println("Your sales tax is $"+totalTax);
103. System.out.println("The total amount due is $"+(totalAmount - discountAmount + totalTax));
104. System.out.println("");
105. }
106. }
Questions
1. List one variable declaration and one constant declared in the code, along with the line number where you found the declaration. Why did the programmer declare it as a variable or constant?
2. What data types are referenced in the code on pages? For each data type, provide the line number of a declaration using that data type as well as the declaration itself. Additionally, list the primitive data types available in Java that are not referenced in the code.
3. Identify the different operators in the code, along with the line number where you found the operator example. Also identify the type of each operator listed as arithmetic, logical, relational, empty, or conditional.
4. Identify the control flow statements in the code. For each control flow statement, give the line number where you found the statement example. Also, list whether that statement is a decision-making, looping, or branching statement.
5. Identify the class definitions, object instantiations, and method calls in the code. Give the line number where you found each.
Below is a hypothetical example
Example: Class definitions
• Patient, line 22
• InsuranceCompany, line 49
• Physician, line 77 Object instantiations
• Alfred Smith, line 89
• Southwest HMO, line 95
• Dr. Smiley Jones, line 98 Method calls
• scheduleFollowUp(“Anne White”, “02/08/19”, “12:45”), line 124
• remitBill(“George Torres”, 33535), line 155
• referPatient(“Bob Allen”), line 189
In: Computer Science
Assume a linear model and then add 0-mean Gaussian noise to generate a sample. Divide your sample into two as training and validation sets.
Use linear regression using the training half. Compute error on the validation set. Do the same for polynomials of degrees 2 and 3 as well
In: Computer Science