Premium Essay

Lab 11

In:

Submitted By dianetran10
Words 384
Pages 2
Part A:
1. The first problem is to count the number of even and odd elements in an array of integers. The next problem is to place them into an array of length 2. Then, return the array with the elements.

2. The linear search will be helpful because its meant for finding specific values.

3. public static int[] evenOdds(int[] values) { // your work here int[] myArray = new int[2]; for (int element: values) { if (element % 2 == 0) { myArray[0]++; } else { myArray[1]++; } } return myArray; }
4. You do not have to compute both

5. public static int[] evenOdds(int[] values) { // your work here int[] myArray = new int[2]; for (int element: values) { if (element % 2 == 0) { myArray[0]++; } else { myArray[1]++; } } return myArray; }

Part B:
1. I will remove the duplicates by checking the word before it. If it is the same as the current word, remove the current word. When I find them, i will remove them.

2. Done.

3. Yes, all the tests passed.

4. public void removeAdjacentDuplicates() { // your code here for (int i = 1; i < words.size(); i++) { if (words.get(i).equals(words.get(i - 1))) { words.remove(i); i--; } } }

5. Done.

6. Done.

7. Yes I finally passed all the tests.

8. public void removeAllDuplicates() { for (int i = 0; i < words.size(); i++) { for (int j = i + 1; j < words.size(); j++) { if

Similar Documents

Premium Essay

Hiro

...Hrs | Instruction Mode: L (lab) and P (class) Professor Andrew Holder holdera@umkc.edu • SCB 113 • 816-235-2293 • 913-543-3709 (fax) Office Hours: T/Th 1:00-4:00, 5:00 – 7:30 Lecture: T/Th 4PM | Labs: T/Th 1PM (AFT), 5PM (EVE) Credit: Lab + Lecture = 4 credits | Format: Lab + Lecture (P) Lecture / Class Policies and Procedures Correspondence with UMKC Student Learning Outcomes Scientific Reasoning & Quantitative Analysis * Apply principles/methods of sciencea, mathb, statisticsc and logicd to solve problems and draw logical inferences. * Chpt 3: Experimental Error (c) * Chpt 4: Statistics (c) * Chpt 6: Chemical Equilibrium (a, b, d, e, f) * Chpt 7: Activity & Systematic Trtmnt, (a, d, e, h) * Chpt 8: Monoprotic Acid-Base Equil., * Chpt 9: Polyprotic Acid-Base Equil. (a, d, e, g, h) * Develop quantitative literacy enabling comprehensione and evaluationf of info in broad contexts. * Chpt 3: Experimental Error, Chpt 4: Statistics (f) * Chpt 5: Quality Assurance and Calibration Methods (c) * Understand methodsg/principlesh of scientific discovery and their application * Sxn 0-2: The Analytical Chemist’s Job (g, h) * Sxn 0-3: General Stages in a Chemical Analysis (g, h) * Chpt 2: Tools of the Trade (g) * Carrying out laboratory analyses (g, h) * Chpt 10: Acid-base Titrations, Chpt 11: EDTA Titrations (g, h) ...

Words: 4091 - Pages: 17

Premium Essay

Cyber Chem Lab 11

...Expt. 11 Phase Changes Purpose: To examine the states of matter of H2O under changes in temperature and pressure. Data: | Pressure (atm) | Temperature(degrees Celsius) | Gas Volume(L) | Liquid Volume(L) | Ice Volume(L) | Heat change | Room Temperature | 1.000 | 20.00 | 0.000 | .1470 | 0.000 | 0.000 | 4 atm. | 1.000 | 200.0 | 317.6 | 0.000 | 0.000 | 0.000 | .5 atm | .5000 | 150.0 | 566.7 | 0.000 | 0.000 | 412.0 | Lowest atm found | 0.004 | -20.00 | 0.000 | 0.000 | .1600 | -144.8 | Questions: 1. At what temperature does the water begin to boil and start turning into vapor? 100 degrees Celsius. 2. At the boiling point when you have a mixture of liquid and vapor and you are applying heat, does the temperature change? No. 3. After all of the liquid has boiled off and turned into vapor, does the temperature increase? Yes. 4. How does the vapor volume compare with the original amount of liquid volume you had when you started the experiment? Vapor volume increased as the liquid volume decreased until the liquid volume reached zero liters. 5. At what temperature does the vapor start condensing into liquid? 144.83 degrees Celsius. 6. How does the volume of water you have now ( at room temperature) compare with the volume of water you started out with? Same volume of .147 liters. 7. While the water is freezing does the temperature continue to deop? Yes. 8. Is the ice volume higher or lower than the original volume of water? The ice...

Words: 420 - Pages: 2

Premium Essay

Rules

...Lab Rules & Regulations 1. The computer lab provided by the University is solely for educational and research activities. Students are prohibited from using the lab for any other reasons. 2. Students must have a valid student ID card to use the computer labs. 3. Students must abide by all rules and regulations, such as those shown on booking sheets, computer screens, and notices near the computers or on the wall. 4. Two-hour Usage Rule: When the lab is full and students are waiting for a vacant computer, the two-hour rule will apply. Students will be limited to 2 hours on the computer per session. 5. All users must abide by the license requirements of any software or resources being used on the computer. 6. The downloading of non-coursework related materials is strictly prohibited on the campus network as it uses much of the network bandwidth, thus slowing down all internet access. 7. All personal data must be saved on a floppy disk, handy drive or on your Home drive. Do not save personal data on the computer hard drive. 8. Please be reminded to scan your handy drive before use to reduce the risk of any virus outbreak. 9. The Management is not responsible for any loss of data or personal belongings regardless of the cause. 10. No moving or unplugging of any equipment in the labs. 11. No pornographic and offensive images & videos. 12. No games (both computer and physical). 13. No...

Words: 413 - Pages: 2

Premium Essay

Information Centre

...Computer Lab Rules & Regulations Swinburne University computing facilities may only be used by current Swinburne students and staff. Swinburne identity card must be presented upon request. The computing facilities should only be used for educational and research purposes. The following rules and regulations apply to all lab computers on campus. Lab Rules & Regulations 1. The computer lab provided by the University is solely for educational and research activities. Students are prohibited from using the lab for any other reasons. 2. Students must have a valid student ID card to use the computer labs. 3. Students must abide by all rules and regulations, such as those shown on booking sheets, computer screens, and notices near the computers or on the wall. 4. Two-hour Usage Rule: When the lab is full and students are waiting for a vacant computer, the two-hour rule will apply. Students will be limited to 2 hours on the computer per session. 5. All users must abide by the license requirements of any software or resources being used on the computer. 6. The downloading of non-coursework related materials is strictly prohibited on the campus network as it uses much of the network bandwidth, thus slowing down all internet access. 7. All personal data must be saved on a floppy disk, handy drive or on your Home drive. Do not save personal data on the computer hard drive. 8. Please be reminded to scan your handy...

Words: 484 - Pages: 2

Free Essay

Checkpoints

...ManagementFile organization General Terms Performance, Design Keywords High performance computing, parallel computing, checkpointing, parallel file systems and IO ∗ LANL Technical Information Release: 09-02117 Los Alamos National Laboratory ‡ Carnegie Mellon University § Pittsburgh Supercomputing Center † (c) 2009 Association for Computing Machinery. ACM acknowledges that this contribution was authored or co-authored by a contractor or affiliate of the U.S. Government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only. SC09 November 14–20, Portland, Oregon, USA. Copyright 2009 ACM 978-1-60558-744-8/09/11 ...$10.00. 100 Speedup (X) Parallel applications running across thousands of processors must protect themselves from inevitable system failures. Many applications insulate themselves from failures by checkpointing. For many applications, checkpointing into a shared single file is most convenient. With such an approach, the size of writes are often small and not aligned with file system boundaries. Unfortunately for these applications, this preferred data layout results in pathologically poor performance from the underlying file system which is optimized for large, aligned writes to non-shared files. To address this fundamental mismatch, we have developed a virtual parallel log structured file system, PLFS. PLFS remaps an application’s ...

Words: 12373 - Pages: 50

Premium Essay

Ch. 11 a Modeling Meiosis Lab

...Name Class Date Guided Inquiry • Skills Lab Chapter 11 Lab Modeling Meiosis Problem How does meiosis increase genetic variation? Introduction Most cells in organisms that reproduce sexually are diploid. They have two sets of chromosomes and two complete sets of genes. Gametes are an exception. Gametes are the cells that combine during sexual reproduction. In animals, these cells are called sperm and eggs. Gametes are haploid cells with only one set of chromosomes. Meiosis is the process in which haploid cells form from diploid cells. In this lab, you will model the steps in meiosis. You will make drawings of your models. You will also identify points in the process that can lead to greater genetic variation. Skills Focus Use Models, Sequence, Draw Conclusions Materials • pop beads • magnetic centromeres • large sheet of paper • colored pencils • scissors Safety Do not direct the points of the scissors toward yourself or others. Use the scissors only as instructed. Pre-Lab Questions 1. Control Variables Why must you use the same number of beads when you construct the second chromosome in Step 1? Name Class Date 2. Infer Why is the longer chromosome pair used to model crossing-over? 3. Calculate A diploid cell has two pairs of homologous chromosomes. How many different combinations of chromosomes could there be in the gametes? Procedure The diploid cell in your model will...

Words: 694 - Pages: 3

Free Essay

Student

...Net-Worm.Win32.Kido.ih Detected | Feb 20 2009 07:04 GMT | Released | Apr 02 2009 16:24 GMT | Published | Feb 20 2009 07:04 GMT | Manual description Auto description This description was created by experts at Kaspersky Lab. It contains the most accurate information available about this program. Manual description Auto description This is a description which has been automatically generated following analysis of this program on a test machine. This description may contain incomplete or inaccurate information. Technical Details Payload Removal instructions Technical Details This network worm spreads via local networks and removable storage media. The program itself is a Windows PE DLL file. The worm components vary in size from 155KB to 165KB. It is packed using UPX. Installation The worm copies its executable file with random names as shown below: %System%\<rnd> %Program Files%\Internet Explorer\<rnd>.dll %Program Files%\Movie Maker\<rnd>.dll %All Users Application Data%\<rnd>.dll %Temp%\<rnd>.dll %Temp%\<rnd>.tmp <rnd> is a random string of symbols. In order to ensure that the worm is launched next time the system is started, it creates a system service which launches the worm’s executable file each time Windows is booted. The following registry key will be created: [HKLM\SYSTEM\CurrentControlSet\Services\netsvcs] ...

Words: 1158 - Pages: 5

Free Essay

Test

...Major Milestones of the Telecommunications Industry 1837 Samuel Morse invents the telegraph - The information age began with the telegraph, which was invented by Samuel F.B. Morse in 1837. This was the first instrument to transform information into electrical form and transmit it reliably over long distances. The earliest form of electrical communication, the original Morse telegraph of 1837 did not use a key and sounder. Instead it was a device designed to print patterns at a distance. 1858 Transoceanic telegraph cable is laid – The transoceanic telegraph cable is an undersea cable running under the Atlantic Ocean used for telegraph communications. The first communications occurred August 16, 1858, reducing the communication time between North America and Europe from ten days, the time it took to deliver a message by ship, to a matter of minutes. 1876 Alexander Graham Bell invents the telephone - The telegraph was followed by Alexander Graham Bell's invention of the telephone in 1876. The magneto-telephone was one of the first telephones on which both transmission and reception were done with the same instrument. 1885 - Incorporation of the American Telephone and Telegraph company (AT&T). After its incorporation in 1885, the American Telephone and Telegraph company dominated the telecommunications market. 1888 - Heinrich Hertz discovers the electromagnetic wave 1895 - Marconi begins experimenting with wireless telegraph 1901 Guglielmo Marconi invented the radio—the...

Words: 727 - Pages: 3

Premium Essay

Unit 1 Pt1420

...Unit 1 Research 1 PT1420 In the 1970s the programming language that was most popular was Pascal. Pascal was designed in 1968-69 but published in 1970. Niklaus Wirth created the Pascal language to “1) make available a language suitable for teaching programming as a systematic discipline based on fundamental concepts clearly by the language, and 2) to define a language whose implementations could be both reliable and efficient on then-available computers. In 1972 the C programming language was developed by Dennis Ritchie. C was created to work with the system Unix. “Unix gives C such advanced features as dynamic variables, multitasking, interrupt handling, forking, and strong, low-level, input-output. Because of this, C is very commonly used to program operating systems such as Unix, Windows, the MacOS, and Linux.” In the 1980s the popular programming language was C++. C++ was developed at Bell Laboratories. C++ is a general purpose multi-paradigm spanning compiled language that has both high-level and low-level languages’ features. It was started as an enhancement to the C programming language, Bjarne Stroustrup in 1979. In the 1990s Java was the popular programming language. It was created in 1991 developed by James Gosling at Sun Microsystems and release in 1995. In the 2000s Visual Basic (VB) was popular in the programming world. VB was developed from BASIC which was originally developed in 1964 by John Kemeny and Thomas Kurts. VB is a Microsoft programing language and software...

Words: 261 - Pages: 2

Free Essay

Indian Ipr

...2/16/2014 Intellectual Property creation witnessing steady growth in India: Report - Economic Times You are here: Home > Collections > India RELATED ARTICLES Budget 2012: Relax corporate tax and surcharges to boost... March 5, 2012 Intellectual Property creation witnessing steady growth in India: Report PTI Jun 26, 2013, 06.43PM IST Bharti Airtel gives IP contract to Alcatel Lucent India June 1, 2012 Tags: Texas Instruments general motors | Mercedes-Benz | investments | intellectual property | Intel | Hewlett-Packard | | gdp | Alstom | Alcatel Lucent Alcatel-Lucent launches IP Transformation Center Septemb er 8, 2009 IN-DEPTH COVERAGE India Intellectual Property Alcatel-lucent Alstom NEW DELHI: The country's contribution to Intellectual Property (IP) creation is witnessing a steady growth, however, investments in R&D and patent activities in the country are still relatively slow when compared to developed nations, a report says. According to globalisation and market expansion advisory firm Zinnov's study 'Enhancing the IP Quotient in MNC R&D centres', IP creation is witnessing steady growth in MNC R&D centres, but investments in R&D and patent activities in India are still relatively slow. (A sector-wise analysis…) The study further said India spends just 1 per cent of its GDP on R&D, while countries like Israel spends 4.2 per cent, Japan 3.7 per cent, US 2.7 per cent and China 2.0 per cent...

Words: 815 - Pages: 4

Free Essay

The Birth and Evolution of Transistors and Impact on the Transport Industry

...Electronics rely heavily on electronic switching and amplification to generate and capture the various signals which allow them to operate. A controllable valve that allows a small signal to control a much larger signal does this, and could be related to a controllable valve used in the control of water flow. This was once done by a device known as vacuum tube but was later brought down to a much lower production scale for a variety of industrial, economical and business related reasons. Bell Laboratories, the research arm of telecommunications company American Telephone and Telegraph’s (AT&T) director Mervin Kelly put together the first team of researchers and scientists placed on the task of research and development of a solid state-semiconductor later called a transistor that would supersede vacuum tubes and provide numerous advantages. The success of this development would prove to change the computing, electronics and telecommunications systems altogether. Up until the invention of the transistor a vacuum tube was used in the control, amplification and generation of electrical signals. Vacuum tubes are tubes usually made from glass and designed in an airtight manner as to keep the flow of “cathode rays” from external disturbance as they pass from each terminal and laid the foundation for numerous technical innovations, such as the light bulb discovered by Thomas Edison (fig. 1). Joseph John Thomson further made a vacuum tube and placed a third terminal to attain a grasp...

Words: 1787 - Pages: 8

Premium Essay

Classwork

...1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1 1 1111111111111111111111111111111111111111111111111 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 111 11 1 1...

Words: 261 - Pages: 2

Free Essay

Hotel

...Tourism 2012 No.9 OCTOBER 2012 VISITOR STATISTICS SEPTEMBER 2012 SUMMARY VISITOR ARRIVALS STATISTICS SEPTEMBER 2012 Tables 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Visitors and cruise ship passengers, 2002 - 2012 Visitor arrivals and average length of stay, 2006 - 2012 Visitor arrivals by purpose of visit, 2009 - 2012 Visitor arrivals by country of residence and month, 2012 Visitor departures: distribution of length of stay, 2003 - 2012 Visitor arrivals by mode of transport, 2011 - 2012 Visitors stay by location, 2011 - 2012 Visitors stay by accommodation, 2011 - 2012 Resident departures by purpose of visit, 2012 Resident departures by country of destination, 2012 Charts Chart 1 – Visitor arrivals January - September, 2010-2012 Chart 2 – Visitor arrivals by leading markets (January - September) 2011 v/s 2012 Chart 3 – Visitors stay by location, January - September 2012 SUMMARY 1. Fifteen thousand four hundred and sixty two visitors arrived in Seychelles during the month of September 2012, reflecting an increase of 17% compared to September 2011. This also included visitors in transit. The figure was 25% above the average for the same month of the last five years. In September 2012, visitors stayed for an average of 9.9 compared to 9.8 nights in September 2011 (Table 2). 2. (93%) of visitors arriving in September 2012 were on holiday, whilst 2% were on business or combining business with a holiday (Table 3). (71%) of visitors were from Europe, 12% from Africa, 13% from Asia...

Words: 9893 - Pages: 40

Premium Essay

Blogging

...Blogging is popular among the people in today’s society, especially amongst teenagers. In fact, the number of blogs is exploding, with about 14 million existing blogs. On average, the number of blogs is doubling every five months. There are many advantages of blogging. Firstly, people can use as an online dairy, using it to share the day’s happening in her life with other visitors on the net. Furthermore, if the blogger (author of the blog) has met up with certain incidents in her life, he can share it on the blog and others can console or praise him, by giving comments or leaving a message in the blog’s tag board, depending on the incident. Blogging can also be a good way to relieve stress as some way wants to use their blog to vent out their frustration or pour out their woes when stress becomes too much for them. Some bloggers even use their blogs to flaunt their literati skills by posting poems about themselves or things around them. Secondly, bloggers can also use their blogs to inform others on a certain topic which happens to be his niche, thus allowing others who are interested in the topic to learn some tricks from the blog, they are also post questions to the blogger if they meet up with problems. Even Mr. Donald Trump is doing so, he launched the Trump Blog last month to share his insights into and answer questions about corporation ethics, personal success and business dilemmas. Other organizations are also using blogs to make announcements to...

Words: 663 - Pages: 3

Free Essay

Aspodij

...fornia, start-up, Shockley Semiconduc tor Laboratory. Shockley had been part of the Bell Labs team that invented the transistor. He had quit his job and come west to start his own company, telling people his goal was to make a million dollars. Everyone thought he was crazy. Shockley knew he wasn't. Unlike a lot of the people at Bell Labs, he knew the transistor was going to be big. Shockley had an idea about how to make transistors c heaply. He wa s going to f abric a te them out of si li con. He had come to this valley, south of San Francisco, to start production. He felt like hewas on the cusp of history, in the right place at the right time. All that he needed was the right people. Shockleywas leaving nothingto c hance. Tod a y's in ter vi ew wa s J i m Gibb ons . Hewa s a young guy, earl y twenti es . He already had a Stanford Ph.D. He had s tudied a t Cambridgetoo - on a Fulbri ght sc holars hip he'dwon. Gibbons was si tting in front of hi m ri ght now, in Shockley's Quonset hut of fice. Shockley picked up his s topwa tch. In Augus t 1957 William Shockleywas recrui ting s taff for hisPalo Alto, Cali fornia, start-up, Shockley Semiconduc tor Laboratory. Shockley had been part of the Bell Labs team that invented the transistor. He had quit his job and come west to start his...

Words: 447 - Pages: 2