Consider the following class definition:
public class Parent {
private int varA;
protected double varB;
public Parent(int a, double b){
varA = a;
varB = b;
}
public int sum( ){
return varA + varB;
}
public String toString( ){
return "" + varA + " " + varB;
}
}
Consider that you want to extend Parent to Child. Child will have a third int instance data varC.
Using the class definitions for Parent and Child from Question 2, write a Java application that will represent a family of 4 members.
In: Computer Science
Activity Statement- The Payroll department at xyz company would like you to develop a computer program that will determine the net pay of an employee. Design a Python program, which utilizes modules, that asks the user to enter the Name of employee, the total number of hours worked by the employee, and the hourly pay rate of the employee. The program will determine the Employee Gross Pay, the Paid Federal Taxes ( 30% of the Employee Gross Pay ), the Paid State Taxes ( 10% of the Employee Gross Pay ), and the Employee Net Pay ( Gross Pay - Federal Taxes - State Taxes ). In addition, the program will display the following items:
Activity Instructions-
In: Computer Science
Please use the Java program below to test the following regex pattern (in the table) and record the output, and explain how the output is generated.
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexTestBarness {
public static void main(String[]
arg) {
Scanner input = new Scanner(System.in);
while (true)
{
System.out.println("Enter a regex pattern: ");
String regex = input.nextLine();
//
Create a regex pattern
Pattern pt = Pattern.compile(regex);
System.out.println("Enter a input string to search: ");
String sr = input.nextLine();
// Create a Matcher object
Matcher mt = pt.matcher(sr);
boolean found = false;
while (mt.find()) {
System.out.printf("I found the text \"%s\" starting at " +
"index %d and ending at index
%d.\n",
mt.group(), mt.start(),
mt.end());
found = true;
}
if(!found){
System.out.println("No match found.");
}
}
}
}
regex pattern |
test string |
output |
explanation |
[^abc] |
abc |
No match found. |
Any character except a, b, or c |
GAATTC |
TGCAGAATTCGGG |
||
\d |
Homework01 |
||
\D |
2010 |
||
\s |
this is a regex |
||
\s+ |
this is a regex |
||
[A-Z][A-Z]\s\d{5} |
MD 20943 |
In: Computer Science
Match the source of a property with the form of normalization it is first required in
|
|
In: Computer Science
Create a python script that reads in the contents of CityPop.csv and stores the data in a container. Task 2 will expect that your program can find cities by name within the container, so think about that as you set up your data container. Briefly describe how you store the data in comments. *It won't let me post the CSV file
In: Computer Science
hi, can you please create me a game that is not too hard but not too easy using pygame in python. can you also explain the codes in each line ?
In: Computer Science
Question 1:
Explain what I/O operation service provides. Describe why user application programs cannot provide these services.
Question 2 :
Discuss the advantage and disadvantages of a layered approach.
In: Computer Science
please research software build and automation tools such as Maven, ANT, and Gradle. Answer the following in your post:
- What are used for and how are they used? - Compare and contrast each of the tools. - What are the benefits and best uses of each tool? Make sure you main post is 200 words.
In: Computer Science
In: Computer Science
Consider the following class definition:
public class Parent {
private int varA;
protected double varB;
public Parent(int a, double b){
varA = a;
varB = b;
}
public int sum( ){
return varA + varB;
}
public String toString( ){
return "" + varA + " " + varB;
}
}
Consider that you want to extend Parent to Child. Child will have a third int instance data varC.
In: Computer Science
In C++, write a program that will read up to 10 letters (characters) into an array and write the letters back to the screen in the reverse order. The program should prompt the user to input all values and can determine whether the input has ended by a punctuation mark such as ‘.’ (make sure that you’ll include meaningful and intuitive messages to the user).
For example, if the input is abcde, the output should be edcba. Include appropriate messaging (UI) to the user.
In: Computer Science
In JAVA
Create a simple guessing game, similar to Hangman, in which the user guesses letters and then attempts to guess a partially hidden phrase. Display a phrase in which some of the letters are replaced by asterisks: for example, G* T*** (for Go Team). Each time the user guesses a letter, either place the letter in the correct spot (or spots) in the phrase and display it again or tell the user the guessed letter is not in the phrase. Display a congratulatory message when the entire correct phrase has been deduced. Add to this the ability for the user to guess the entire phrase. Save the game as SecretPhrase.java.
Add to this an array of 10 phrases to choose from. Generate a random number to use to select one of the phrases from your array.
Also, add a second array to the the alphabet. As the user guesses a letter mark this letter in the alphabet array as used. When the user attempts to use a letter that was already used, tell them that letter was already user to please guess another letter.
Make the game loop so after a round the user can choose to play again and a different phrase will be chosen.
In: Computer Science
When is an ECPA relevant? Computer forensics
In: Computer Science
Describe a hypothetical scenario where someone would act in ways that are not legal, but it is ethical.
Describe a hypothetical scenario where someone would act in ways that are legal, but not ethical.
(150 Words for each case)
In: Computer Science
Design an O(n log n) algorithm that takes two arrays A and B (not necessarily sorted) of size n of real numbers and a value v. The algorithm returns i and j if there exist i and j such that A[i] + B[j] = v and no otherwise. Describe your algorithm in English and give its time analysis.
In: Computer Science