Write a program that reverses a text file by using a stack. The user interface must consist of 2 list boxes and 3 buttons. The 3 buttons are: Read - reads the text file into list box 1. Reverse - reverses the items in list box 1 by pushing them onto stack 1, then popping them from stack 1 (in the reverse order) and adding them to list box 2. Write - writes the contents of list box 2 to a new text file. At first, only the Read button is enabled. After it is clicked, it is disabled and the Reverse button is enabled. After it is clicked, it is disabled and the Write button is enabled. After it is clicked, it is disabled. The name of the input text file is "input.txt". The input text file will contain no more than 100 lines of text. This fact is not needed by the program. It simply means that memory usage is not an issue. The name of the output text file is "output.txt". Notes: 1. The name of your main class should be ReverseFileViaStack. 2. Use the Java class library Stack class for your stack. 3. Use a border layout for your contents pane. 4. In the north region include the following title: Reverse a Text File via a Stack. 5. Use a panel in the center region to contain the 2 list boxes (side-by-side). 6. Place the 3 buttons in the south region. 7. A useful resource for this project is the week 5 video: Java GUI List Components
In: Computer Science
Implement a priority queue using a DoublyLinkedList where the
node with the highest priority (key) is the right-most node.
The remove (de-queue) operation returns the node with the highest
priority (key).
If displayForward() displays List (first-->last) : 10 30 40
55
remove() would return the node with key 55.
Demonstrate by inserting keys at random, displayForward(), call
remove then displayForward() again.
You will then attach a modified DoublyLinkedList.java (to contain
the new priorityInsert(long key) and
priorityRemove() methods), and a driver to
demonstrate as shown above.
Use the provided PQDoublyLinkedTest.java to test your code.
public class PQDoublyLinkedTest
{
public static void main(String[] args)
{ // make a new list
DoublyLinkedList theList = new DoublyLinkedList();
theList.priorityInsert(22); // insert at front
theList.priorityInsert(44);
theList.priorityInsert(66);
theList.priorityInsert(11); // insert at rear
theList.priorityInsert(33);
theList.priorityInsert(55);
theList.priorityInsert(10);
theList.priorityInsert(70);
theList.priorityInsert(30);
theList.displayForward(); // display list forward
Link2 removed = theList.priorityRemove();
System.out.print("priorityRemove() returned node with key: ");
removed.displayLink2();
} // end main()
} // end class PQDoublyLinkedTest
_____________________________________________________________________________________________________________________________________________________
// doublyLinked.java
// demonstrates doubly-linked list
// to run this program: C>java DoublyLinkedApp
class Link
{
public long dData; // data item
public Link next; // next link in list
public Link previous; // previous link in list
public Link(long d) // constructor
{ dData = d; }
public void displayLink() // display this link
{ System.out.print(dData + " "); }
} // end class Link
class DoublyLinkedList
{
private Link first; // ref to first item
private Link last; // ref to last item
public DoublyLinkedList() // constructor
{
first = null; // no items on list yet
last = null;
}
public boolean isEmpty() // true if no links
{ return first==null; }
public void insertFirst(long dd) // insert at front of list
{
Link newLink = new Link(dd); // make new link
if( isEmpty() ) // if empty list,
last = newLink; // newLink <-- last
else
first.previous = newLink; // newLink <-- old first
newLink.next = first; // newLink --> old first
first = newLink; // first --> newLink
}
public void insertLast(long dd) // insert at end of list
{
Link newLink = new Link(dd); // make new link
if( isEmpty() ) // if empty list,
first = newLink; // first --> newLink
else
{
last.next = newLink; // old last --> newLink
newLink.previous = last; // old last <-- newLink
}
last = newLink; // newLink <-- last
}
public Link deleteFirst() // delete first link
{ // (assumes non-empty list)
Link temp = first;
if(first.next == null) // if only one item
last = null; // null <-- last
else
first.next.previous = null; // null <-- old next
first = first.next; // first --> old next
return temp;
}
public Link deleteLast() // delete last link
{ // (assumes non-empty list)
Link temp = last;
if(first.next == null) // if only one item
first = null; // first --> null
else
last.previous.next = null; // old previous --> null
last = last.previous; // old previous <-- last
return temp;
}
// insert dd just after key
public boolean insertAfter(long key, long dd)
{ // (assumes non-empty list)
Link current = first; // start at beginning
while(current.dData != key) // until match is found,
{
current = current.next; // move to next link
if(current == null)
return false; // didn't find it
}
Link newLink = new Link(dd); // make new link
if(current==last) // if last link,
{
newLink.next = null; // newLink --> null
last = newLink; // newLink <-- last
}
else // not last link,
{
newLink.next = current.next; // newLink --> old next
// newLink <-- old next
current.next.previous = newLink;
}
newLink.previous = current; // old current <-- newLink
current.next = newLink; // old current --> newLink
return true; // found it, did insertion
}
public Link deleteKey(long key) // delete item w/ given key
{ // (assumes non-empty list)
Link current = first; // start at beginning
while(current.dData != key) // until match is found,
{
current = current.next; // move to next link
if(current == null)
return null; // didn't find it
}
if(current==first) // found it; first item?
first = current.next; // first --> old next
else // not first
// old previous --> old next
current.previous.next = current.next;
if(current==last) // last item?
last = current.previous; // old previous <-- last
else // not last
// old previous <-- old next
current.next.previous = current.previous;
return current; // return value
}
public void displayForward()
{
System.out.print("List (first-->last): ");
Link current = first; // start at beginning
while(current != null) // until end of list,
{
current.displayLink(); // display data
current = current.next; // move to next link
}
System.out.println("");
}
public void displayBackward()
{
System.out.print("List (last-->first): ");
Link current = last; // start at end
while(current != null) // until start of list,
{
current.displayLink(); // display data
current = current.previous; // move to previous link
}
System.out.println("");
}
} // end class DoublyLinkedList
class DoublyLinkedApp
{
public static void main(String[] args)
{ // make a new list
DoublyLinkedList theList = new DoublyLinkedList();
theList.insertFirst(22); // insert at front
theList.insertFirst(44);
theList.insertFirst(66);
theList.insertLast(11); // insert at rear
theList.insertLast(33);
theList.insertLast(55);
theList.displayForward(); // display list forward
theList.displayBackward(); // display list backward
theList.deleteFirst(); // delete first item
theList.deleteLast(); // delete last item
theList.deleteKey(11); // delete item with key 11
theList.displayForward(); // display list forward
theList.insertAfter(22, 77); // insert 77 after 22
theList.insertAfter(33, 88); // insert 88 after 33
theList.displayForward(); // display list forward
} // end main()
} // end class DoublyLinkedApp
____________________________________________________________________________________________________________________________________________________
In: Computer Science
3. Plot the below scores using the most appropriate type of graph. The goal is to see how these bowlers have performed over time.
|
Day |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
|
Bob |
111 |
133 |
122 |
144 |
124 |
155 |
133 |
166 |
133 |
147 |
|
Ted |
89 |
99 |
111 |
121 |
133 |
133 |
124 |
122 |
120 |
155 |
|
Carol |
144 |
145 |
133 |
155 |
166 |
133 |
177 |
188 |
179 |
157 |
|
Alice |
166 |
177 |
184 |
168 |
147 |
198 |
167 |
178 |
187 |
201 |
4. Plot the scores below for the bowler's scores as a function of their ages. The goal is to see a relationship between two variables...scores vs. ages. Also, create a list according to their ages (oldest first), then their scores (highest first), then their names (alphabetically).
|
Name |
Age |
Score |
|
Matilda |
11 |
121 |
|
Gretel |
21 |
204 |
|
Gertrude |
15 |
144 |
|
Frances |
7 |
34 |
|
Winifred |
33 |
220 |
|
Heather |
26 |
215 |
|
Esther |
9 |
55 |
|
Beulah |
17 |
155 |
|
Marnie |
29 |
178 |
|
Ilse |
14 |
98 |
5. Graph the percentages of the students at a college:
Freshmen = 40%,
Sophomores = 30%, Juniors = 20%, Seniors = 10%
6. Make a spread sheet that calculates your grades in this class.
In: Statistics and Probability
You are studying to enter professions that require high moral
and ethical behavior. Your commitment to such standards should
begin in this class and continue through every class in your
graduate degree program. This week's discussion questions:
1) Why ethics and professional conduct are so important in the
accounting professions, and
2) Why behaving ethically in your graduate studies is critical to
your goal to graduate and work in the accounting industry.
Some major professional accounting
associations/organizations include:
American Accounting Association
American Institute of CPA's
American Society of Women Accountants
American Taxation Association
Association of Certified Fraud Examiners
Association of Government Accountants
Chartered Global Management Accountants
Information Systems Audit and Control Association
Institute of Internal Auditors
Institute of Management Accountants
Institute of Industrial Accountants
Insurance Accounting and Systems Association
International Association of Accounting Education
National Association of Black Accountants
National Society of Accountants
Professional Association of Small Business Accountants
Professional Accounting Society of America
Your state" Society of CPA's
Questions to spark class discussion:
Randomly select one of the professional accounting
organizations from the list below.
Summarize and discuss the professional code of ethics of the organization you selected.
Identify a few of the key codes and or responsibilities of ethical and professional conduct in this organization.
Discuss their importance and how you, as students can model these behaviors.
In: Accounting
As an IT manager, it is imperative to know how well the company you work for is performing overall. This is especially important in order to ensure that the IT operations deliver on supporting the organizational vision and business strategy. Therefore, students will evaluate the factors involved in making the IT department a profit center, especially considering the market's current focus on analytics. First, conduct research to acquire the income statements (also referred to as profit and loss or P&L statements) of any two organizations that have a prominent IT department. Many examples of such organizations are highly publicized and can be located with a general online search for the list of "Fortune 500 companies." You may also utilize the income statements from your own company or a company where you have previously worked. If you decide to include the latter, please use anonymous references for your proposal submission and not include the name of the company. Once the income statements for the two organizations with a prominent IT department have been identified, complete a 250-500 word review with the following components: An analysis of the profitability of the company over various periods of time: monthly, quarterly, or annually. Include a description of the overall areas of success (profits) and any challenging areas (losses). A narrative description of the impact of the P&L on the IT department. Include the specific or potential factors involved in each organization's ability to generate revenue involving IT. A description of the potential methods for reducing IT expenses.
In: Finance
a. Use an equation editor to formulate the null and alternative hypothesis to test the following claim:
“The average life expectancy for all countries is not 68.9 years.”
b. From the AllCountries data, do your best to randomly select 10 of the 213 life expectancies listed. List the 10 values you selected below. (You can use the 10 values from Graded Problem Set 3 if you’d like.)
Bermuda:80.6
Bulgaria: 74.5
Egypt, Arab Rep.: 71.1
Kora Rep: 81.5
Argentina: 76.2
Panama: 77.6
Canada: 81.4
Korea, Dem. Rep.:69.8
Belarus: 72.5
Belize: 73.9
c. Construct a randomization distribution in StatKey to test the above hypothesis. Take at least 1000 samples. Take a screenshot of your StatKey page, and paste it below. (Your graph will differ from other students.)
d. Find and interpret the p-value in regards to the hypothesis and claim.
I have randomly selected the 10 life expectancies from the data set and hopefully, you don't need anything else from the dataset
In: Statistics and Probability
Suppose that you are the CEO of a discount airline that caters to students on tight budgets who want to travel to warm locations when the weather gets cold. Currently, your airline flies small regional jets from the MBS International Airport to 6 cities in Florida. Assume that your airline has a monopoly on the local market.
|
P |
Q |
TR |
MC |
|
500 |
100 |
50,000 |
60,000 |
|
450 |
200 |
90,000 |
70,000 |
|
400 |
300 |
120,000 |
80,000 |
|
350 |
400 |
140,000 |
90,000 |
|
300 |
500 |
150,000 |
100,000 |
|
250 |
600 |
150,000 |
110,000 |
|
200 |
700 |
140,000 |
120,000 |
|
150 |
800 |
120,000 |
130,000 |
|
100 |
900 |
90,000 |
140,000 |
|
50 |
1,000 |
50,000 |
150,000 |
In: Economics
Suppose that you are the CEO of a discount airline that caters to students on tight budgets who want to travel to warm locations when the weather gets cold. Currently, your airline flies small regional jets from the MBS International Airport to 6 cities in Florida. Assume that your airline has a monopoly on the local market.
|
P |
Q |
TR |
MC |
|
500 |
100 |
50,000 |
60,000 |
|
450 |
200 |
90,000 |
70,000 |
|
400 |
300 |
120,000 |
80,000 |
|
350 |
400 |
140,000 |
90,000 |
|
300 |
500 |
150,000 |
100,000 |
|
250 |
600 |
150,000 |
110,000 |
|
200 |
700 |
140,000 |
120,000 |
|
150 |
800 |
120,000 |
130,000 |
|
100 |
900 |
90,000 |
140,000 |
|
50 |
1,000 |
50,000 |
150,000 |
In: Economics
Case one:
Intergovernmental working group of experts on international
standards of accounting and reporting
1. What are International Financial Reporting Standards (IFRS)?
2. Many concerns are expressed in this article. List three factors
that you think
are causing concern about the impact of adoption of IFRS.
3. Consider each of the three factors you mentioned in response to
question 2.
(a) Is there empirical evidence to support the factor?
(b) Is the analysis leading from the factor to the concerns about
adoption
of IFRS scientific or naturalistic in its approach? Explain your
answer.
Case two:
1. On 1 January 2005 Australia adopted IASB standards.
(a) Do you agree with this change? Why or why not?
(b) Who stands to gain from Australia’s adoption of IASB
standards?
Explain.
(c) Who stands to lose from Australia’s adoption of IASB
standards?
Explain.
From 1 January 2005 the AASB will issue Australian equivalents to
IFRS.
This process involves the AASB issuing IASB exposure drafts as
exposure
drafts in Australia. Constituents can provide comments on standards
to the
AASB and IASB. Final standards issued by the IASB are
subsequently
issued in Australia with any additional paragraphs necessary to
make the
standards suitable for public sector and not-for-profit
entities.
Requirement:
Students are required to answer questions in an essay format
(introduction, body,
conclusion
In: Accounting
You have been appointed as the Software Quality Assurance
Manager for a
project that enables students to access their results on their
android phones.
As the person responsible for the overall quality aspects, its your
interest to
ensure that strong quality assurance practices are put in place to
forestall any
software failure by the end-users.
i. It is important that you conduct requirements validation as
part of your
quality assurance practices in this project. Could you explain in
your own
words, what is requirements validation and its importance? What is
the
impact if this process is not well conducted?
ii. Requirements review is one of the requirements validation
techniques
in quality assurance. If you are going to make requirements review,
which
method do you prefer to do the activity, formal or informal
method?
Explain why you choose the method. Suggest and explain the types
of
checks that should be done on the requirements in the
software
requirement specification.
b. You are investigating systems requirements for a shipping
company. Assume
that you have set up an interview with the manager of the
shipping
department. Your objective is to determine how shipping works and
what the
information requirements for the new system will be.
Make a list of questions—three (3) open ended and three (3)
closed ended—
that you would use. Include four (4) questions or techniques you
would use
to ensure you find out about the exceptions.
c. During interviews, why is it important to seek the opinions of the interviewee?
In: Computer Science