In Software engineering, Describe in detail the role of class-oriented metrics in assessing the quality of an object-oriented system.
In: Computer Science
in java
Design and implement a class called Dog that contains instance data that represents the dog’s name and age. Define the Dog constructor to accept and initialize instance data. Include getter and setter methods for the name and age. Include a method to compute and return the age of the dog in “person years” (seven times the dog’s age). Include a toString method that returns a one-line description of the dog. Create a Tester class called Kennel, whose main method instantiates and updates several Dog objects.
In: Computer Science
in java
Write a program that will print the following output
1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 1 2 4 8 16 8 4 2 1 1 2 4 8 16 32 18 8 4 2 1
In: Computer Science
Girl?
Jojo is looking for his love by sending messages to strangers on a dating application. Because he knows that many people are using fake profile photos, he found a way to find out the gender of the user by their user names. If the number of distinct characters in one’s user name is even, then she is a female, otherwise he is a male. Help him to find out their gender! '
Format Input:
The first line is an integer T representing the number of test cases. The next T lines each consist of a string S representing the user name in the dating application.
Format Output:
For each test case output “Case #X: ”, where X is the case number, followed by “Yay” if the user is a female, or “Ewwww” if the user is a male.
Constraints
• 1 ≤ T ≤ 100
• 1 ≤ |S| ≤ 105
• S only consist of lowercase letter.
Sample Input 1 (standard input):
1
abb
Sample Output 1 (standard output):
Case #1: Yay
Sample Input 2 (standard input):
2
abbc
za
Sample Output 2 (standard output):
Case #1: Ewwww
Case #2: Yay
Note:
On the first sample input, first test case, the user is female because there are 2 different letters namely “a” and “b”, so the output is “Yay”.
note : USE C language, integer must be the same as the constraint, DONT USE VOID, RECURSIVE(RETURN FUNCTION), RESULT, code it under int main (must be blank){
In: Computer Science
in java
Create a class called Customer in three steps: • (Step-1): • Add a constructor of the class Customer that takes the name and purchase amount of the customer as inputs. • Write getter methods getName and getPrice to return the name and price of the customer. You can write a toString() method which returns printed string of Customer name and its purchase. • (Step-2): Create a class called Restaurant. • Write a method addsale that takes customer name and purchase amount of the customer in the class restaurant and stores it into an array list. • Write a method nameBestCustomer that returns customer name who bought highest sale in the restaurant. • (Step-3): Write a tester class that prompts the user to enter name and purchase of the customers and display the name of the customer who bought highest sales in the restaurant.
In: Computer Science
I need this code in java.
Task
(1) Create two files to submit:
Build the ItemToPurchase class with the following specifications:
(2) In main(), prompt the user for two items and create two
objects of the ItemToPurchase class. Before prompting for the
second item, call scnr.nextLine(); to allow the
user to input a new string. (2 pts)
Ex:
Item 1 Enter the item name: Chocolate Chips Enter the item price: 3 Enter the item quantity: 1 Item 2 Enter the item name: Bottled Water Enter the item price: 1 Enter the item quantity: 10
(3) Add the costs of the two items together and output the total
cost. (2 pts)
Ex:
TOTAL COST Chocolate Chips 1 @ $3 = $3 Bottled Water 10 @ $1 = $10 Total: $13
This is the given code so far:
import java.util.Scanner;
public class ShoppingCartPrinter {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int i = 0;
String productName;
int productPrice = 0;
int productQuantity = 0;
int cartTotal = 0;
// TODO Create new item1 and new item2
// Prompt for item 1 details from user, create itemToPurchase
object
System.out.println("Item 1");
System.out.println("Enter the item name:");
productName = scnr.nextLine();
System.out.println("Enter the item price:");
productPrice = scnr.nextInt();
System.out.println("Enter the item quantity:");
productQuantity = scnr.nextInt();
System.out.println("");
// TODO: Set item1 fields here
// Promptr for item 2 details from user, create itemToPurchase
object
System.out.println("Item 2");
System.out.println("Enter the item name:");
scnr.nextLine(); // DO NOT OMIT THIS LINE
productName = scnr.nextLine();
System.out.println("Enter the item price:");
productPrice = scnr.nextInt();
System.out.println("Enter the item quantity:");
productQuantity = scnr.nextInt();
System.out.println("");
// TODO set item2 here
// Add costs of two items and print total
cartTotal = (item1.getPrice() * item1.getQuantity()) +
(item2.getPrice() * item2.getQuantity());
System.out.println("TOTAL COST");
System.out.println(item1.getName() + " " + item1.getQuantity()
+
" @ $" + item1.getPrice() + " = $" +
(item1.getPrice() * item1.getQuantity()));
System.out.println(item2.getName() + " " + item2.getQuantity()
+
" @ $" + item2.getPrice() + " = $" +
(item2.getPrice() * item2.getQuantity()));
System.out.println("");
System.out.println("Total: $" + cartTotal);
return;
}
}
In: Computer Science
in java
write a program that initializes a String variable with "Welcome to Jac444!". Then, use methods of the String class to examine the string and output a few properties of the string, namely The string by itself The length of the string The first character in the string The last character in the string The first word of the string The last word of the string Make sure that your output also contains how many words exists in the string.
In: Computer Science
In: Computer Science
COURSE : IT Enterprise systems
Consider the Relations below
STUDENT
|
Student# |
Std-Name |
Address |
|
1 |
Smith |
Jeddah |
|
2 |
Bob |
Buraidah |
|
3 |
Alice |
Dammam |
COURSE
|
Student# |
Course Code |
Course-Name |
|
1 |
IT241 |
Operating System |
|
2 |
IT210 |
Computer Network |
|
2 |
IT445 |
Decision Support System |
Write a query using the Right Outer Join to retrieve the record from the two relations. Also, construct the table displaying the output of your query.
note: NEED A UNIQUE ANSWER AND NO HANDWRITING PLEASE..
THANK YOU
In: Computer Science
import os
def process_dir(p, indent):
for item in os.listdir(path):
if os.path.isfile("{0}/{1}".format(path, item)):
print("\t"*indent, item)
elif os.path.isdir("{0}/{1}".format(path, item)):
print("\t"*indent, "\x1b[1;31m{}\x1b[0;0m".format(item))
process_dir("{0}/{1}".format(path, item), indent+1)
else:
print("Not a file or directory")
path=input("Enter a valid system path: ")
print("\x1b[1;31m{}\x1b[0;0m".format(path))
process_dir(path, 1)
In: Computer Science
In: Computer Science
Write a JAVA program that implements the following disk-scheduling algorithms:
In: Computer Science
2. Define the following terms in your own words :
a. Computer.
b. Hardware (H/W).
c. Software (S/W).
d. Input Devices.
e. Output devices.
f. Primary Memory.
g. Peripheral device.
In: Computer Science
COURSE : IT Enterprise systems
Consider the following enterprise scenario and answer the following questions. ABC is a wholesale company that sells electrical equipment and provides a website from which customers can inquiry about products and identify what they want to buy. When costumers order electrical equipment, they place their order on the ABC website. ABC does not own or hold any equipment as inventory. Rather, the ABC orders the equipment from the appropriate supplier and ranges for the equipment to be shipped directly from the supplier to the customers. The customers pay ABC and receive receipts. The ABC also pays the suppliers and keeps the excess as revenues.
note: NEED A UNIQUE ANSWER AND NO HANDWRITING PLEASE..
THANK YOU
In: Computer Science
Q1. The following is an X.509 certificate.
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
3d:0e:98:b2:bf:af:fa:9e:99:91:05:64:69:6e:11:2a
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US, O=Symantec Corporation,
OU=Symantec Trust Network,
CN=Symantec Class 3 EV SSL CA - G3
Validity
Not Before: Aug 14 00:00:00 2017 GMT
Not After : Sep 13 23:59:59 2018 GMT
Subject: ... C=US/postalCode=22230, ST=Virginia,
L=Arlington/street=4201 Wilson Blvd,
O=National Science Foundation, OU=DIS,
CN=www.nsf.gov
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
00:ca:fb:26:78:06:25:b1:9e:67:1d:69:0b:10:06:
cf:25:b6:7d:de:8e:56:80:e1:1c:38:52:62:43:fd:
...
Exponent: 65537 (0x10001)
Signature Algorithm: sha256WithRSAEncryption
4b:0d:62:11:b4:dc:78:09:12:c1:1b:24:ff:98:43:58:1c:54:
0a:34:be:8f:3f:12:8f:17:4a:fe:5b:26:13:1a:5f:a7:87:ad:
...
ba:2c:10:c7:bc:8b:2c:15:6e:0c:d2:d0:8b:74:52:c8:ed:05:
0b:9b:62:41
(a) Who issues the certificate?
(b) Who is the owner of the certificate?
(c) Who generated the signature on this certificate, and how can this signature be verified?
(d) The public key contained in this certificate is based on the RSA algorithm. Using the RSA algorithm, to encrypt a message M, we calculate Me mod n. What is the value of e and n in this public key? If a number is too large, you only need to write down its first four bytes.
(e) Before issuing the certificate, the CA needs to do a verification regarding the subject field. What is the main purpose of a certificate, i.e. why a subject needs a certificate? What has been the steps taken by the CA to verify the subject in this case?
In: Computer Science