First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "PasswordChecker" (without the quotation marks) that gets a String of a single word from the user at the command line and checks whether the String, called inputPassword, conforms to the following password policy. The password must: Be exactly three characters in length Include at least one uppercase character Include at least one digit If the password conforms to the policy, output "The provided password is valid." Otherwise, output "The provided password is invalid because it must be three characters in length and include at least one digit and at least one uppercase character. Please try again." Some other points to remember... Do not use a loop in this program.
The Character class offers various methods to assist us in finding a digit or cased letter. Remember to press "." to locate these methods and to leverage the online resources shown in our course thus far." For this PA, do not use pattern matching (aka "regular expressions").
In: Computer Science
Inheritance – Address, PersonAddress, BusinessAddress Classes
Assignment
Download the Lab6.zip starter file. Use 7zip to unzip the file using ‘Extract Here’. Open the project folder in IntelliJ.
Examine the Main and Address classes. You are going to add two classes derived from Address: BusinessAddress and PersonAddress.
Create BusinessAddress class
The printLabel method should print (using System.out.println()) // Here is the 1st place I'm getting stuck ?? All I did was create the BusinessAddress class. I appreciate your assistance
First line – the businessName field
Second line – the address2 field if it is not null or empty
Third line – the StreetAddress field if it is not null or empty
Fourth line – city field followed by a comma and space, the state field followed by two spaces, and the zip field
Create PersonAddress class
The printLabel method should print (using System.out.println())
First line – the personName field
Second line – the StreetAddress field
Third line – city field followed by a comma and space, the state field followed by two spaces, and the zip field
Modify Main class
Add the following three BusinessAddress objects to the list.
BusinessName |
Address2 |
StreetAddress |
City |
State |
Zip |
Columbus State |
Eibling 302B |
550 East Spring St. |
Columbus |
OH |
43215 |
AEP |
P.O. Box 2075 |
null |
Columbus |
OH |
43201 |
Bill’s Coffee |
null |
2079 N. Main St. |
Columbus |
OH |
43227 |
Add the following three PersonAddress objects to the list.
PersonName |
StreetAddress |
City |
State |
Zip |
Saul Goodman |
1200 N. Fourth St. |
Worthington |
OH |
43217 |
Mike Ehrmentraut |
207 Main St. |
Reynoldsburg |
OH |
43211 |
Gustavo Fring |
2091 Elm St. |
Pickerington |
OH |
43191 |
Example Output
Columbus State
Eibling 302B
550 East Spring St.
Columbus, OH 43215
====================
AEP
P.O. Box 2075
Columbus, OH 43201
====================
Bill's Coffee
2079 N. Main St.
Columbus, OH 43227
====================
Saul Goodman
1200 N. Fourth St.
Worthington, OH 43217
====================
Mike Ehrmentraut
207 Main St.
Reynoldsburg, OH 43211
====================
Gustavo Fring
2091 Elm St.
Pickerington, OH 43191
====================
public class Main { public static void main(String[] args) { Address[] addressList = new Address[6]; // TODO Add 3 person addresses to list // TODO Add 3 business address to list for (Address address : addressList) { address.printLabel(); System.out.println("===================="); } } }
public abstract class Address { private String streetAddress; private String city; private String state; private String zip; public Address(String streetAddress, String city, String state, String zip) { this.streetAddress = streetAddress; this.city = city; this.state = state; this.zip = zip; } public String getStreetAddress() { return streetAddress; } public void setStreetAddress(String streetAddress) { this.streetAddress = streetAddress; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getZip() { return zip; } public void setZip(String zip) { this.zip = zip; } public String toString() { return streetAddress + "\n" + city + ", " + state + " " + zip + "\n"; } public abstract void printLabel(); }
public class BusinessAddress extends Address { private String businessName; private String address2; public BusinessAddress(String streetAddress, String city, String state, String zip, String businessName, String address2) { super(streetAddress, city, state, zip); this.businessName = businessName; this.address2 = address2; } public String getBusinessName() { return businessName; } public void setBusinessName(String businessName) { this.businessName = businessName; } public String getAddress2() { return address2; } public void setAddress2(String address2) { this.address2 = address2; } public void printLabel() { } }
In: Computer Science
Write a C program to run on unix to read a text file and print it to the display. It should count of the number of words in the file, find the number of occurrences of a substring, and take all the words in the string and sort them (ASCII order). You must use getopt to parse the command line. There is no user input while this program is running.
Usage: mywords [-cs] [-f substring] filename
• The -c flag means to count the number of words in the file. A word would be a series of characters separated by spaces or punctuation. A word could include a hyphen or a single apostrophe.
• The -s option means to print the words in the file sorted by ASCII order.
• The -f option will find the number of occurrences of the given substring.
• You may have any number of the flags included or none of them.
• The order they should be run would be: -s first, -c second, and -f third.
--------------------------------------------------------------------------------
Format of parsing the command line (main method established), rest of functionality needed as explained above:
int value = 0; int main(int argc, char **argv) { extern char *optarg; extern int optind; int c, err = 0; int cflag = 0, sflag = 0, fflag = 0; char *substring; // usage static char usage[] = "usage: mywords [-cs] [-f substring] filename"; while ((c = getopt(argc, argv, "csf:")) != -1) switch (c) { case 'c': cflag = 1; break; case 's': sflag = 1; break; case 'f': fflag = 1; substring = optarg; break; case '?': err = 1; break; } if (fflag == 1) { printf("%c ", substring); } }
In: Computer Science
In: Computer Science
Modify the MergeSort program given to support searching subarrays.
Program is listed below in Java.
public class Merge
{
public static void sort(Comparable[] a)
}
Comparable[] aux = new Comparable[a.length];
sort(a, aux, 0, a.length);
}
private static void sort(Comparable[] a, Comparable[] aux, int lo, int hi)
{ //Sort a[lo, hi)
if (hi - lo <= 1) return;
int mid = lo (hi + lo) / 2;
sort( a, aux, lo, mid);
sort(a, aux, mid, hi);
int i = lo, j = mid;
for (int k = lo; k < hi; k++)
if (i == mid) aux[k] = a[j++];
else if (j == hi) aux[k] = a[i++];
else if (a[j].compareTo(a[i]) < 0) aux[k] = a[j++];
else aux[k] = a[i++];
for (int k = lo; k < hi; k++)
a[k] = aux[k];
}
public static void main(String[] args)
{ }
}
Note: The user would give an unsorted list of words as command-line arguments along with the starting and ending index of the subarray that should be sorted. The program should print out a list where the strings between the given indexes are sorted alphabetically.
Sample runs would be as follows.
>java MergeSort 2 4 toy apply sand bay cat dog fish
toy apply bay cat sand dog fish
>java MergeSort 0 3 was had him and you his the but
and had him was you his the but
In: Computer Science
In: Computer Science
Typed please.How can we implement efficient search operations? In this area, we will discuss various algorithms, including sequential search, sorted search, and binary search. The characteristics of these algorithms will be analyzed, such as the running times and the type of lists they can be used with.
In: Computer Science
ystems Analysis and Design in a Changing World (7th Edition)
on the Spot Courier Service
Case study for chapter # 6 [page # 182]
Previous chapters have described the technological
capabilities that Bill Wiley wants for servicing his customers. One
of the problems that Bill has is that his company is very small, so
he cannot afford to develop any special-purpose equipment or even
sophisticated software.
Given this limitation, Bill’s need for advanced technological
capabilities comes at an opportune time. Equipment manufacturers
are developing equipment with advanced telecommunications
capabilities, and freelance software developers are producing
software applications—many of which provide the capabilities that
Bill needs. The one caveat is that because this will be a live
production system, it needs to be reliable, stable, error-free,
dependable, and maintainable.
Let us review some of the required capabilities of the new system,
which has been described in previous chapters:
Customers
■ Customers can request package pickup via the
Internet.
■ Customers can check the status of packages via the
Internet.
■ Customers can print mailing labels at their
offices.
Drivers
■ Drivers can view their schedules via a portable
digital device while on their routes.
■ Drivers can update the status of packages while on
their routes.
■ Drivers can allow customers to “sign” for packages
that are delivered.
they only plan to provide some design specifications and guidelines
to each resort. The resort will be responsible for connecting to
the Internet and for providing a secure wireless environment for
the students.
1. For which subsystem(s) is(are) integrity and security controls
most important? Why?
2. What data should be encrypted during trans- mission through
resort wireless networks to SBRU systems? Does your answer change
if students interact with SBRU systems using a cell phone
(directly, or as a cellular modem)?
■ The system “knows” where the driver is on his route
and can send updates in real time.
■ Drivers can accept payments and record them on the
system.
Bill Wiley (management)
■ Bill can record package pickups from the ware-
house.
■ Bill can schedule delivery/pickup runs. ■
Bill can do accounting, billing, etc. ■ Bill can access
the company network from his
home. Given these requirements, do the following:
1. What kind of fraud is possible in this scenario? By
the customer? By the truck driver? By
colaboration between system users? What steps should Bill take to
minimize the opportunity for fraud?
2. What kind of access controls should be put in place?
For the customer? (Notice the customer has no financial
transactions. Would you change your answer if the customer could
also make payments online?) For the truck driver? For Bill? Are the
typical userID and password sufficient for all three, or would you
require more or less for each?
In: Computer Science
In: Computer Science
Polish notation, also known as Polish prefix notation or simply prefix notation, is a form of notation for logic, arithmetic, and algebra. Its distinguishing feature is that it places operators to the left of their operands.
The expression for adding the numbers 1 and 2, in prefix notation, is written as “+ 12” rather than “1 + 2”. In more complex expressions, the operands may be nontrivial expressions including operators of their own. For instance, the expression that would be written in conventional infix notation as (5 + 6) * 7 can be written in prefix as * (+ 5 6) 7
In this assignment, we only care about binary operators: + - * and /.
For binary operators, prefix representation is unambiguous and bracketing the prefix expression is unnecessary. As such, the previous expression can be further simplified to * + 5 6 7
The processing of the product is deferred until its two operands are available (i.e., 5 plus 6, then multiplies the result with 7). As with any notation, the innermost expressions are evaluated first, but in prefix notation this ”innermost-ness” is conveyed by order rather than bracketing.
Your task is to create a class that convert a prefix expression to a standard form (otherwise known as infix) and compute the prefix expression.
Main function
The test script will compile your code using
g++ -o main.out -std=c++11 -O2 -Wall *.cpp
It is your responsibility to ensure that your code compiles on the university system. g++ has too many versions, so being able to compile on your laptop does not guarantee that it compiles on the university system. You are encouraged to debug your code on a lab computer (or use SSH).
Create a main function that takes in one line. The line contains a list of operators and operands separated by spaces. The input doesn’t contain parenthesis. An operator is a character from +, -, *, and /. An operand is a nonnegative integer from 0 to 99. You are asked to convert the prefix expression to an infix form and output its value as well. If the expression is not a valid prefix expression, your program should output “Error”.
Sample input: * - 5 6 7
Sample output: (5 - 6) * 7 = -7
Sample input: * 5
Sample output: Error
Sample input: * 5 6 7
Sample output: Error
Please provide the .h, .cpp and main.cpp file for this, like Polish.h Polish.cpp and main.cpp thank you
In: Computer Science
Master thesis on :
Blockchain technology and its uses on today's on today's business life. [at least 4000 word ]
In: Computer Science
1. Explain why we need CAD CAM technologies
2. List advantages of 3D model over 2D model
3. Briefly explain 3 types of digital 3D modeling
4. Discuss the completeness, unambiguousness
and uniqueness of solid modeling schemes.
In: Computer Science
I am working on routing path and subnet. The question is I am given with source 10.1.240.240 and the destinations is 10.2.240.240. How is the packet traveling?
In: Computer Science
C language problem.
Suppose I open I file and read a integer 24. And I want to store them into a array byte [].
The answer should be byte[0] = 0x9F.
How can I do that?
In: Computer Science
1) Use Python to answer the below questions.
a) What is the output of the following python code?
def function(x):
return x * 5
print(func(7) * func(5))
b) What is the output of the following code fragment?
required_course = "Programming", "Security",
"Cybersecurity"
a,b,c =
required_course
print(b)
In: Computer Science