CS 0445 Summer 2023 Assignment 1

Online: Wednesday, May 17, 2023 Due: All source files plus a completed Assignment Information Sheet zipped into a single .zip file and submitted properly to the submission site by 11:59PM on Saturday, May 27, 2023 (Note: see the submission information page for submission details) Late Due Date: 11:59PM on Tuesday, May 30, 2023 Purpose: To refresh your Java programming skills and to emphasize the object-oriented programming approach used in Java. Specifically, you will work with control structures, class-building, interfaces and generics to create and utilize a simple array-based data structure. Goal 1: To design and implement a simple class MultiDS that will act as a simple data structure for accessing Java Objects. Your MultiDS class will primarily implement 2 interfaces – MyQ and Shufflable. The details of these interfaces are explained in the files MyQ.java and Shufflable.java. Read these files over very carefully before implementing your MultiDS class. Goal 2: To utilize your MultiDS class by implementing a simple version of the card game "War". In this case your program will be a client using MultiDS and the details of the MultiDS implementation will be abstracted out. Details 1: For the details on the functionality of your MultiDS class, carefully read over the files MyQ.java, QueueInterface.java, Shufflable.java and Assig1A.java provided on the Web site. You must use these files as specified and cannot remove/alter any of the code that is already written in them. In Lecture 3 we discussed the author's QueueInterface, which is an ADT that allows for adding at the logical back (enqueue) and removing from the logical front (dequeue) of the data structure. The methods in this interface are specified in file QueueInterface.java. See the Lecture 3 Powerpoint presentation for some background and ideas about the QueueInterface. In Recitation Exercise 2 you implemented (or will implement) two simple classes called PrimQ1 and PrimQ2 that satisfy QueueInterface but in an inefficient way. Specifically, they use an array that maintains one logical end or the other of the queue at index 0 and thus requires shifting for one of the enqueue() or dequeue() operations. We will discuss specific run-time analysis of these implementations a bit later in the course, but it is intuitive that there is a lot of overhead in both of these implementations. A queue can be implemented in a more efficient way with an array if we allow both logical sides of the queue to move along the array in a circular fashion. For example, consider the array below: 0 1 2 3 4 5 6 7 10 20 30 40 50 front back In this queue, both front and back will move forward within the array as we enqueue() or dequeue() in the queue. For example, if we enqueue(55) in this queue, it will look as follows: 0 1 2 3 4 5 6 7 10 20 30 40 50 55 front back If we then dequeue(), the queue will look as follows: 0 1 2 3 4 5 6 7 20 30 40 50 55 front back Note that for this approach to work effectively, both back and front will need to "wrap" around the end of the array when necessary. This enables the beginning indices in the array to be reused. For example, if we now enqueue(66), the array will appear as follows: 0 1 2 3 4 5 6 7 66 20 30 40 50 55 back front Your MultiDS class must implement the queue using this circular approach. Note that when the queue is implemented in this way, we do not have to shift data in the array and either of the enqueue() or dequeue() methods can be implemented with just a few statements. However, there are some special cases to consider (ex: detecting a full array, handing an empty queue) so think carefully about how you would implement your class. The MyQ interface extends QueueInterface, adding 2 new, simple methods (size() and capacity()). Your MultiDS must implement MyQ as well as the Shufflable interface. Shufflable has just one method, shuffle(), which will permute the data within the collection in a pseudo-random way. Thus, your class header should be: public class MultiDS implements MyQ, Shufflable Important Note: The primary data within your MultiDS class must be an array. You may not use any predefined Java collection class for your MultiDS data. In addition to the interface methods, you will also need a constructor and a toString() method for your MultiDS class. See file Assig1A.java for details on these methods. Your MultiDS class must also be able to dynamically resize when necessary. As we discussed (or will discuss) in Lecture 4, array-based data structures can be logically resized by allocating new, larger arrays and copying the data from the old array into the new array. This can be done in your MultiDS class but, due to its circular nature, you must be careful when doing this to preserve the queue order. Think about how you would resize for this class. Note that after resizing (but before doing anything else) the capacity() of your MultiDS should double but the size() should be unchanged. After you have finished your coding of MultiDS, the Assig1A.java file provided for you should compile and run correctly, and should give output identical to the output shown in the sample executions (except for the segments where the data is shuffled, since it will be pseudo-random in that case). Details 2: War is a card game played often by children that has many variations. You will implement the simple version as described below: • Initially shuffle a 52-card standard deck of cards • Deal the cards out completely to two players, alternating cards to each player • Do the following until one player is out of cards or until a set number of rounds have completed: • Each player plays the top card in their hand • If one player's card beats the other (has a higher rank – suits don't matter), that player puts both cards into their discard pile • If the players tie, it is a WAR, so do the following until the WAR is resolved: • Each player plays a card without comparing (in the physical game this would be placing a card “face down” on the table). • Each player plays one more card and compares in the same way as above • The winner of the WAR takes all played cards (initially compared cards, uncompared cards, second compared cards) For solution whatsapp +923325198690

Assignment solution

Q no: 1 We know a DFA must have only one start state. Is a DFA valid without any acceptance stage? All following questions use Alphabets ∑= {0,1} 

Q no: 2 Build a DFA for the following language: L = {w | w is a binary string that must contains 01 as a substring} 

Q no: 3 Build a DFA for the language having Null only ? 

Q no: 4 Build a DFA for the language having Everything ? 

Q no: 5 Build a DFA for the language that accepts nothing i.e. empty Language? 

Q no: 6 Build a DFA for the language having Null and 01 as a substring? 

Q no: 7 Build a DFA for the following language: L = { w | w is a binary string that has even number of 0s } ( note: 1’s can be zero to many) 

Q no: 8 Build a DFA for the following language: L = { w | w is a binary string that has even number of 1s only} (Note: because it mention only there will be no zero at all) 

Q no: 9 Build a DFA for the following language: L = { w | w is a binary string that has even number of 1s OR even number of 0s} 

Q no: 10 Build a DFA for the following language: L = { w | w is a binary string that has even number of 1s AND even number of 0s} e.g. build for string 1100 and for 1001

For solution:
contact +923325198690
price Rs. 2000 0r $20 only

Data Structure is an implementation of A. class B. Algorithm C. Abstract data type D. structure

Data Structure is an implementation of 
 A. class 
B. Algorithm 
C. Abstract data type 
D. structure




Assignment

1/5 CCSW 227 Software Requirements Engineering CCSE Assignment 2 List of possible applications/softwares 1 Production management application of “NADEK” Company. 2 Customer Management System of “SACO” Company 3 Repair (Maintenance) service System of the “EXTRA” Company. 4 Track Order System of the “NOON” company. Tasks 1- Choose one application/software from the above list. 2- Apply the “Brainstorming Paradox” to find and write the correspondent exceptions and problems faced by the chosen application or Part of it (specify the part if needed). 3- Apply the SWOT analysis for evaluation of the actual situation (based on the ideas you have about the application). Bonus You will get a 1 Mark bonus, if you apply the “Osborn Checklist” to explore the transformation possibilities that you can apply to your key creativity idea. This idea must be written before the application of the “Osborn Checklist”. For better understanding, try to read the annex. Try to explore also: Course Reference Topic 6: Elicitation Lab Reference Lab 6 2/5 CCSW 227 Software Requirements Engineering CCSE Annex Brainstorming paradox Brainstorming paradox is a modification of regular brainstorming in that events that must not occur are collected. Afterward, the group develops measures to prevent the events collected earlier from happening. Through this process, participants often realize which actions may entail negative results. With this method, risks can be identified early on and countermeasures can be developed. SWOT A SWOT analysis is a compilation of your company's strengths, weaknesses, opportunities and threats. The primary objective of a SWOT analysis is to help organizations develop a full awareness of all the factors involved in making a business decision. Use your SWOT analysis to discover recommendations and strategies, with a focus on leveraging strengths and opportunities to overcome weaknesses and threats. 3/5 CCSW 227 Software Requirements Engineering CCSE Another explanation 4/5 CCSW 227 Software Requirements Engineering CCSE Osborn Checklist for transforming ideas The Osborn Checklist, also known as SCAMPER, is an ideation method created by Alexander Osborn, the godfather of brainstorming. The method parts from existing objects, products or concepts, which are subjected to a set of actions which invite to convert the initial object into new ideas. What can you modify, add, minimize, substitute, rearrange or combine? This complete list of questions can lead to both subtle improvements as well as total new approaches of the original solution. Template: 5/5 CCSW 227 Software Requirements Engineering CCSE
solution

Mechanism 2 – Independent Analysis

 The structure shown in Figure 3 is part of a transfer bridge used by cars to drive onto a ferry. Due to the varying tidal heights, the bridge (member AC) may be in any position from ΞΈmin = 0° to ΞΈmax = 25°. The mass of member AC, mb, is equal to the last 4 digits of your A#, in kg, and acts at the center of mass, midspan of the structure. Member BC is a hydraulic cylinder which varies in length depending on the bridge position, and may be assumed to have a negligible mass.

Analysis:


Visualize the mechanism at πœƒπ‘šπ‘–π‘› = 0°, πœƒπ‘šπ‘Žπ‘₯ = 25°, and an intermediate position ΞΈ. 2. Disassemble the mechanism and draw a free body diagram for member AC in the intermediate position. Hydraulic cylinder BC is a 2-force member. 3. Produce geometric and equilibrium relationships to relate the force in cylinder BC and the resultant pin force at A (𝑅𝐴) to the angle of the bridge, πœƒ. The analysis will be similar to that performed in the previous section of this lab. 4. Input these relationships into a spreadsheet. 5. Verify the accuracy of your spreadsheet by analysing the bridge by hand at angle πœƒ = 15. 6. Produce a plot showing the full range of angle πœƒ on the x-axis and cylinder force 𝐹𝐡𝐢/𝑅𝐴 on the y-axis.


Mechanism 1 – Guided Analysis


 1. FBD of mechanism in the intermediate position 

2. List of geometric and equilbrium formulas used for the analysis 

3. Screenshot of your spreadsheet 

4. Plots of a. πœƒ vs. 𝐹𝐷𝐸 b. πœƒ vs. π‘…π‘œ and 𝑅𝑐  



Mechanism 2 – Independent Analysis 

1. FBD of mechanism in the intermediate position 

2. Derivation and list of the geometric and equilibrium equations used for the analysis. SHOW YOUR CALCULATIONS!! They do not have to be typed up, but they should be neat. 

3. Screenshot of your spreadsheet 

4. Hand calculation of member BC and pin forces at A for the bridge at an angle πœƒ = 15°. 5. Plot of πœƒ vs. 𝐹𝐡𝐢 and 𝑅𝐴 

Include a title page with the lab title, your name, A#, and the date. The report should not be formal, but it should be complete. Presentation will count for 20% of the value of this lab, so ensure your report is professional looking, neat and organized. Your digital submission must be a single PDF document. 


solution

EGNE1203 Statics Lab 1: Analysis of a Ventilation Door Mechanism

EGNE1203 Statics Lab 1: Analysis of a Ventilation Door Mechanism

Team work: Students may work together, but each student is required to do their own analysis and submit their own lab report

Introduction 

Machines are movable structures comprised of a several pin connected multi-force members which are designed to provide a mechanical advantage, to transmit forces or to otherwise complete a specific task. Examples of common machines include pumps, hand tools such as pliers, clamps, or vice grips, parts of construction equipment such as the arm of an excavator or lifting clamps, and mechanisms used to open/close windows/doors. Using the principles of statics, we can analyze such mechanisms by considering equilibrium of the entire structure as a whole, or we can disassemble it into its constituent parts and consider the equilibrium for each. This allows us to understand how forces are transferred through the structure. The limitation of a static analysis is that it is valid for only a specific configuration; if we wish to calculate the forces while the structure is in a different orientation we must perform a new analysis from scratch.



This lab will examine how we can use software tools, namely spreadsheets, to analyze a complex mechanism not just in one configuration, but in a generalized manner. This will allow us to quickly determine the maximum and minimum forces acting on each part and plot these forces across different configurations. 


Mechanism 1 – Guided Analysis  

The problem we will examine today is a mechanism which opens a 30 kg ventilation door (OAP) using the expansion and contraction of a hydraulic piston (DE). The mechanism is shown in Figure 2 in the closed position.


Uttarakhand Open University BA 3rd year Assignment

Course Title: Application Oriented Course in Consumer Studies
Course Code: ACS-1

Maximum Marks: 30

1. Put () against the correct statement and (×) against the incorrect statement. (1×3= 3 Marks)

i) Pleasant sales persons can persuade a consumer to try a new product. ( )

ii) An arbitrator brings about a settlement between a consumer and a seller.

( ) iii) It is not necessary for consumer organizations working for the Indian

consumer to become a member of the international organization. ( )

2. Fill in the Blanks. (1×3= 3 Marks)

i) ……………………. is a person who buys goods and services and makes use of public utilities as well as natural resources like air and water.

ii) ………………………. deals with the relation between organisms and their environment. It now includes human kind’s dependence and relationship with environment.

iii) …………………………. means any article of food, being a produce of agriculture or horticulture in its natural form.

3. Write Answer inone line. (2 ×2= 4 Marks)
i) Family Life Cycle
ii) Poverty Line
4. Short Answer Type Questions. (5 ×2= 10 Marks)

i) Briefly describe the growth of consumer movement.




ii) Describe the characteristics of mass media.

5. Essay Type Question. (10 ×1= 10 Marks)

i) Define consumer. Briefly explain the salient features of the Consumer Protection Act, 1986.

For Solution contact +923325198690