Description
need a 10 examples of java errors
syntax errors
Unformatted Attachment Preview
Chapter 5 – Decisions
Chapter Goals
• To be able to implement decisions using if statements
• To understand how to group statements into blocks
• To learn how to compare integers, floating-point numbers, strings,
and objects.
• To recognize the correct ordering of decisions in multiple branches
• To program conditions using Boolean operators and variables
The if Statement
• The if statement lets a program carry out different
actions/instructions depending on a condition.
• The if statement has two parts: a condition and a body
if (amount
Purchase answer to see full attachment
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
The program is aimed to check whether a year is a leap or not public class Leap Year { public static void main(String[ args) { year = 1900; boolean leap = false; if(year % 4 = 0) { if( year % 100 == 0) ...
Completion Status:
100%
Review
Review
Anonymous
Nice! Really impressed with the quality.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
Named Entity Recognition Structure Person and Location Entities Lab Report
Use given script to download 1 Wikipedia page (not Marymount)Run NLTK’s NER tool.Examine both the PERSON and LOCATION En ...
Named Entity Recognition Structure Person and Location Entities Lab Report
Use given script to download 1 Wikipedia page (not Marymount)Run NLTK’s NER tool.Examine both the PERSON and LOCATION EntitiesCalculate Precision, Recall, and F-Measure for both Person or Location (whichever your document has)pip install pymediawikiTo Harvest WIKIfrom mediawiki import MediaWikiwikipedia = MediaWiki()p = wikipedia.page('Marymount University')content= p.contentprint(content)To Tag Named Entities1) Word Tokenize a Sentence2) POS tag the tokens3) print(nltk.ne_chunk(tagged))
3 pages
Differences
SASS stands for Syntactically Awesome Style Sheets. It is designed to be compatible with all versions of CSS. To use SASS, ...
Differences
SASS stands for Syntactically Awesome Style Sheets. It is designed to be compatible with all versions of CSS. To use SASS, you need to follow an ...
IT 206 Iglobal University Logarithm Questions
Q.1) What it the Bog O of the following equation? 10n3 + 24n2 + 3n log n + 144 O(n^3) O(10n^3) O(n^2) O(n) ...
IT 206 Iglobal University Logarithm Questions
Q.1) What it the Bog O of the following equation? 10n3 + 24n2 + 3n log n + 144 O(n^3) O(10n^3) O(n^2) O(n) Q.2) What it the Bog O of the following equation? n2 + n log n + 50 Group of answer choices O(n) O(n^2) O(log n^2) Q.3) What it the Bog O of the following equation? 5 log2n + 15 log n O(n) O(log n) O(1) Q.4) Exponential identity: (ab)n = an + bn True False Q.5) Match the following Big O notation with their respective operation. O(1) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic O(log n) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic O(n) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic O(n^2) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic Q.6) What is the Big-O of the code snippet below? #include <stdio.h> int main() { printf("Hello World"); } Group of answer choices O(Cn) O(n) O(1) O(n^2) Q.7) What is n in the pseudocode below? What is the Big-O? Pseudocode: list_Sum(A,n) { total =0 n = 8000 for i=0 to n-1 sum = sum + A[i] return sum } Group of answer choices n; O(1) 8000; O(A,i) 8000; O(n) 8000; O(n^2) Q.8 ) Exponential identity: aman = amn Group of answer choices True False Q.9) Logarithm identity: logb M + logb N = logb (M/N) Group of answer choices True False Q.10) Say your and your coworkers write an algorithm that takes in an array of numbers and returns the highest one, select the the three (3) best analysis below that describes your algorithm. Group of answer choices The absolute slowest it can run is Linear time – O(n) The absolute fastest it can run in Quadratic time – Ω(n^2) The absolute fastest it can run is Linear time – Ω(n) The absolute slowest it can run is constant time time – O(c) This algorithm be tightly asymptotically bound – so we can also say it’s Θ(n) Q.11) Match the analysis for Mileage problem: How much gas does it take to go 200 miles? Group of answer choices Straight, downhill, wind at your back [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict “Average” terrain [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict Winding, uphill, gravel road, inclement weather [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict Q.12) Divide and Conquer Divide ==> solve the problem recursively. Conquer ==> put the problem into a number of sub-problems. Combine ==> put the problem into one solution to give a solution to the original problem. Group of answer choices True False Q.13) Heap Sort: Build the initial heap from the following array [10, 16, 54, 17, 19, 65, 31] Note: minimum 300 words. Q.14) Heap Sort - max heap: Build the initial heap from the following array [10, 16, 54, 17, 19, 65, 31] a. Show (draw) the max heap with the INITIAL max value a. Show (draw) the max heap AFTER the FIRST max value is removed b. Show (draw) the max heap AFTER the SECOND max value has been removed Note: minimum 300 words Q.15) what is the Worst case time complexity of quicksort? Group of answer choices O(n log n) O(n^2) O(n) Q.16) In Quick sort, the pivot can be any value within the array being sorted, commonly the value of the middle array element. Group of answer choices True False Q,17) MERGE SORT: Draw a diagram showing the merge sort of the following array. [5 2 4 7 1 3 2 6] Q.18) In heap sort - Max heap parents are larger/higher in value that the children In heap sort - Min heap children are larger/higher in value than the parent In quick sort - The parents are larger/higher in value that the children Group of answer choices True False Q.19) RESEARCH QUESTION: Solving the traveling salesman problem via brute-force search. 1. Explain the traveling salesman problem 2. Find an C++, or Python algorithm to solve the salesman problem (list information with an example) 3. What is the Big O? **Please pay attention to details. **Not the number of points Note: Minimum 500 words.
2 pages
First Assignment
Calculate B-cubed precision, recall and F-score given the coreference entities in the system output and answer key. Fill i ...
First Assignment
Calculate B-cubed precision, recall and F-score given the coreference entities in the system output and answer key. Fill in this information in the ...
Similar Content
Software Requirements Analysis
Primary Task Response: Within the Discussion Board area, write 400–600 words that respond to the following questions wit...
Original Work Only
Lab AssignmentsWorth 60 points eachPlease download this document to complete and submit: CIS432 Lab 1, Sailing Adventures ...
Matlab programing
write math lab programing with the instruction on the attachment This project consists of two parts.
Your project report ...
Math 315 numerical analysis
written work in word doc and matlab in .m file...
Northeastern Representation of Data Points Over a Period of Time Sqlda Database
Exercise 22: Time Series AnalysisFirst, using the sqlda database, show the number of monthly sales. Then find the number o...
C++ programing
Odds are a numerical expression, usually expressed as a pair of numbers, used in both gambling and statistics . In statist...
Assignment
Artaic Innovative Mosaic purchases most of its tile from a supplier in China. Each order is ocean-shipped in a container a...
Change Management Plan
An incidence response plan is a detailed document with a set of instructions that guide an organization’s on how to dete...
Fitness Questions
1. In line 3, Why do we have multiple fonts listed? The font-family property can hold numerous font names creating a fallb...
Related Tags
Book Guides
The Remains Of The Day
by Kazuo Ishiguro
Steppenwolf
by Hermann Hesse
Milkweed
by Jerry Spinelli
The Da Vinci Code
by Dan Brown
Mockingjay
by Suzanne Collins
Freakonomics
by Stephen J. Dubner and Steven D. Levitt
Hidden Figures
by Margot Lee Shetterly
Black Beauty
by Anna Sewell
Breakfast at Tiffanys
by Truman Capote
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
Named Entity Recognition Structure Person and Location Entities Lab Report
Use given script to download 1 Wikipedia page (not Marymount)Run NLTK’s NER tool.Examine both the PERSON and LOCATION En ...
Named Entity Recognition Structure Person and Location Entities Lab Report
Use given script to download 1 Wikipedia page (not Marymount)Run NLTK’s NER tool.Examine both the PERSON and LOCATION EntitiesCalculate Precision, Recall, and F-Measure for both Person or Location (whichever your document has)pip install pymediawikiTo Harvest WIKIfrom mediawiki import MediaWikiwikipedia = MediaWiki()p = wikipedia.page('Marymount University')content= p.contentprint(content)To Tag Named Entities1) Word Tokenize a Sentence2) POS tag the tokens3) print(nltk.ne_chunk(tagged))
3 pages
Differences
SASS stands for Syntactically Awesome Style Sheets. It is designed to be compatible with all versions of CSS. To use SASS, ...
Differences
SASS stands for Syntactically Awesome Style Sheets. It is designed to be compatible with all versions of CSS. To use SASS, you need to follow an ...
IT 206 Iglobal University Logarithm Questions
Q.1) What it the Bog O of the following equation? 10n3 + 24n2 + 3n log n + 144 O(n^3) O(10n^3) O(n^2) O(n) ...
IT 206 Iglobal University Logarithm Questions
Q.1) What it the Bog O of the following equation? 10n3 + 24n2 + 3n log n + 144 O(n^3) O(10n^3) O(n^2) O(n) Q.2) What it the Bog O of the following equation? n2 + n log n + 50 Group of answer choices O(n) O(n^2) O(log n^2) Q.3) What it the Bog O of the following equation? 5 log2n + 15 log n O(n) O(log n) O(1) Q.4) Exponential identity: (ab)n = an + bn True False Q.5) Match the following Big O notation with their respective operation. O(1) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic O(log n) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic O(n) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic O(n^2) [ Choose ] Constant log n Logarithmic n log n quadratic Linear Cubic Q.6) What is the Big-O of the code snippet below? #include <stdio.h> int main() { printf("Hello World"); } Group of answer choices O(Cn) O(n) O(1) O(n^2) Q.7) What is n in the pseudocode below? What is the Big-O? Pseudocode: list_Sum(A,n) { total =0 n = 8000 for i=0 to n-1 sum = sum + A[i] return sum } Group of answer choices n; O(1) 8000; O(A,i) 8000; O(n) 8000; O(n^2) Q.8 ) Exponential identity: aman = amn Group of answer choices True False Q.9) Logarithm identity: logb M + logb N = logb (M/N) Group of answer choices True False Q.10) Say your and your coworkers write an algorithm that takes in an array of numbers and returns the highest one, select the the three (3) best analysis below that describes your algorithm. Group of answer choices The absolute slowest it can run is Linear time – O(n) The absolute fastest it can run in Quadratic time – Ω(n^2) The absolute fastest it can run is Linear time – Ω(n) The absolute slowest it can run is constant time time – O(c) This algorithm be tightly asymptotically bound – so we can also say it’s Θ(n) Q.11) Match the analysis for Mileage problem: How much gas does it take to go 200 miles? Group of answer choices Straight, downhill, wind at your back [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict “Average” terrain [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict Winding, uphill, gravel road, inclement weather [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict [ Choose ] Best case No difference (200 miles is 200 Miles) Worst case Average case Can not predict Q.12) Divide and Conquer Divide ==> solve the problem recursively. Conquer ==> put the problem into a number of sub-problems. Combine ==> put the problem into one solution to give a solution to the original problem. Group of answer choices True False Q.13) Heap Sort: Build the initial heap from the following array [10, 16, 54, 17, 19, 65, 31] Note: minimum 300 words. Q.14) Heap Sort - max heap: Build the initial heap from the following array [10, 16, 54, 17, 19, 65, 31] a. Show (draw) the max heap with the INITIAL max value a. Show (draw) the max heap AFTER the FIRST max value is removed b. Show (draw) the max heap AFTER the SECOND max value has been removed Note: minimum 300 words Q.15) what is the Worst case time complexity of quicksort? Group of answer choices O(n log n) O(n^2) O(n) Q.16) In Quick sort, the pivot can be any value within the array being sorted, commonly the value of the middle array element. Group of answer choices True False Q,17) MERGE SORT: Draw a diagram showing the merge sort of the following array. [5 2 4 7 1 3 2 6] Q.18) In heap sort - Max heap parents are larger/higher in value that the children In heap sort - Min heap children are larger/higher in value than the parent In quick sort - The parents are larger/higher in value that the children Group of answer choices True False Q.19) RESEARCH QUESTION: Solving the traveling salesman problem via brute-force search. 1. Explain the traveling salesman problem 2. Find an C++, or Python algorithm to solve the salesman problem (list information with an example) 3. What is the Big O? **Please pay attention to details. **Not the number of points Note: Minimum 500 words.
2 pages
First Assignment
Calculate B-cubed precision, recall and F-score given the coreference entities in the system output and answer key. Fill i ...
First Assignment
Calculate B-cubed precision, recall and F-score given the coreference entities in the system output and answer key. Fill in this information in the ...
Earn money selling
your Study Documents