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
Why is mobile especially important to Rent the Runway? How are customers using mobile devices to engage with the firm? In what ways do retail storefronts help the firm? In what ways are Rent the Runway stores like Apple stores?
In: Operations Management
In: Psychology
Why did the Americans need assistance from the French to ensure victory?
In: Psychology
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
As a leader facing the COVID-19 pandemic, in which of these two directions would you lean in your strategic messaging and why?
Do you agree that the current situation is as uncertain as it is portrayed in this statement? Why or why not?
This is the reading:
The toll the new coronavirus has taken on an economy that was healthy at the start of March came into clear relief when the government said Thursday that 6.6 million Americans had applied for unemployment benefits the week before.
No one weeps for the corporate bosses behind the decisions to lay off many of those people, but these bosses are struggling as they make the toughest calls of their careers. Marriott International Inc.'s CEO told analysts this surpasses the magnitude of 9/11 and the 2008 financial crisis combined. In a letter to employees , General Electric Co.'s CEO said this is an era where the unknowns outweigh the knowns.
Business leaders live by the calendar, attaching forecasts, projects and goals to a specific date or period of time. No one knows when state-issued mandates to stay at home will lift, and that renders a calendar about as useful in 2020 as an eight-track player. It is like stumbling around in the dark.
As quarterly earnings conference calls take place in the coming weeks, expect to hear a lot of "we don't know," "it's hard to say," and "I wish I had a crystal ball." These terms aren't typical for the managing class.
"CEOs are wired to take action," Jerry Colonna , a former venture capitalist who now counsels top executives, told me this week. "It's really hard when they don't really know what action to take. It's like taking a bucket to extinguish a fire and not knowing if the bucket is full of water or confetti."
Bahram Akradi, the Iranian-born founder of the Life Time Inc. health-club chain , is one of those CEOs looking for water in the bucket. I've talked with Mr. Akradi often in recent weeks about how his company is navigating the crisis.
The answer: It isn't pretty. Revenue has all but dried up, nearly $1 billion in new developments are on ice. "These are the facts," he told me during a Wednesday FaceTime session from his Chanhassen, Minn., office. "Empty parking lots are a fact."
Like many honchos I talk to, Mr. Akradi would like political leaders to set a firm date to reopen businesses and end rigid sheltering rules—even if that date is several weeks in the future. He also wants everyone's bills across the country to be postponed in April. For instance, mortgages or car payments due this month should be deferred to May.
Topping the list of concerns Mr. Akradi can control: the 38,000 people on his payroll. He likens Life Time to a boat in troubled waters. "We are in a big, massive storm," he told employees March 25. "We have no idea how long the storm is, or how bad it's going to get. What I'm trying to do is make sure I keep everybody on this ship staying intact and alive. That's all."
Eight days before, when he closed more than 150 clubs in 30 states, he recorded a video message telling employees Life Time could weather a two-week shutdown without breaking much of a sweat. After that, he'd have to get creative.
Last week came another video in which he had to explain why roughly 36,000, or about 90%, of employees were going on furlough as of Wednesday. The move included a commitment to pay 100% of affected workers' insurance premiums and an extra $10 million for a fund to help employees with essentials that unemployment checks won't cover.
This isn't how he wants it. "They've been with me 28 years, busting their rear ends." Now he's encouraging them to buy only the basics and try, if necessary, to negotiate favorable terms with potential creditors.
Mr. Akradi, 58, cut jobs before , during the financial crisis when a slowdown in discretionary income slammed several industries, including fitness. Even cutting under 200 jobs "felt like death, the ugliest thing I've had to do in my life." How much worse is it this time? "It is not even in the same orbit."
The day after my last chat with Mr. Akradi, I talked by phone with ZipRecruiter Inc. founder and CEO Ian Siegel as he kept an eye on two children at his home in Southern California. Mr. Siegel's had just finished a roller-coaster of a month that included laying off or indefinitely furloughing 500 people, roughly a third of the staff.
"All the way up to March 9 we were in a boom economy, and then literally overnight we were in a recession economy." Job seekers use ZipRecruiter to search and apply for jobs posted by companies on its website. Not all hiring has stopped, but listings rapidly declined starting March 10.
He had to decide whether the abrupt decline was a "shock to the system or the new normal." Without an accurate compass, he decided to plan for the worst-case scenario. "We knew we were going to have to make hard choices fast or harder choices later." He intentionally cut to the bone.
Mr. Siegel, 46, and his management team took about a week to figure out what to do. Keeping 700 employees would be manageable considering the company's liquidity and revenue levels. It likely gives ZipRecruiter enough head count to pivot back to growth if there is a sharp boost in hiring at the end of this crisis.
The process was gut wrenching; "definitely the hardest decision I've had to make." Mr. Siegel informed each displaced employee individually via videoconference, making it clear that each one was considered valuable. He hopes to rehire many of them.
Here's an important thing Mr. Siegel takes away from this process: A red hot startup like the decade-old ZipRecruiter can be sobered at a moment's notice.
"I really thought we were hardened, that we were operationally invulnerable," he said. The steps he took last month were "humbling."
These CEOs believe they will emerge and their businesses will eventually resemble what they looked like a month ago. Mr. Siegel said making necessary cuts now means the enterprise can continue to live another day and Mr. Akradi says CEOs like him are as crafty as they are tenacious.
"I'm never going to be faster than the bear," Mr. Akradi told me. "I just have to be faster than a lot of other folks."
Good advice, but outrunning the other guy just got a lot harder to do.
In: Operations Management
The price of Ervin Corp. stock will either be $61 or $90 at the end of the year. Call options are available with one year until expiration. Continuously compounded T-bills currently yield 5.07 %. Suppose the current price of Ervin stock is $76.
What is the value of the call option, using the risk-free approach, if the strike price is $75 per share? (Round answer to 2 decimal places. Do not round intermediate calculations).
In: Finance
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
Orange County Chrome Company manufactures three chrome-plated products—automobile bumpers, valve covers, and wheels. These products are manufactured in two production departments (Stamping and Plating). The factory overhead for Orange County Chrome is $233,300.
The three products consume both machine hours and direct labor hours in the two production departments as follows:
Direct Labor Hours | Machine Hours | |
Stamping Department | ||
Automobile bumpers | 563 | 805 |
Valve covers | 303 | 556 |
Wheels | 340 | 596 |
1,206 | 1,957 | |
Plating Department | ||
Automobile bumpers | 174 | 1,168 |
Valve covers | 177 | 713 |
Wheels | 172 | 756 |
523 | 2,637 | |
Total | 1,729 | 4,594 |
Required: | |
1. | Determine the single plantwide factory overhead rate, using each of the following allocation bases: (a) direct labor hours and (b) machine hours. Round your answers to two decimal places. |
2. | Determine the product factory overhead costs, using (a) the direct labor hour plantwide factory overhead rate and (b) the machine hour plantwide factory overhead rate. Refer to the Amount Descriptions list provided for the exact wording of the answer choices for text entries. Round your answers to the nearest dollar amount. |
In: Accounting
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
What mistakes do people make when they form impressions of you? How might you prevent this from happening? How might you correct them when they do occur?
In: Psychology
In: Computer Science
K-Too Everwear Corporation can manufacture mountain climbing shoes for $33.18 per pair in variable raw material costs and $24.36 per pair in variable labor expense. The shoes sell for $170 per pair. Last year, production was 145,000 pairs. Fixed costs were $1,750,000. |
a. | What were total production costs? (Do not round intermediate calculations and round your answer to the nearest whole number, e.g., 32.) | |
b. | What is the marginal cost per pair? (Do not round intermediate calculations and round your answer to 2 decimal places, e.g., 32.16.) | |
c. | What is the average cost per pair? (Do not round intermediate calculations and round your answer to 2 decimal places, e.g., 32.16.) | |
d. |
If the company is considering a one-time order for an extra 5,000 pairs, what is the minimum acceptable total revenue from the order? (Do not round intermediate calculations and round your answer to the nearest whole number, e.g., 32.) |
|
a. | Total production cost | |
b. | Marginal cost per pair | |
c. | Average cost per pair | |
d. | Total revenue |
In: Finance
In: Economics