Quizermania Logo

Java Programming: Solving Problems with Software Coursera Week 2 Quiz answers

In this post, you will get all weeks quiz answers of Java Programming: Solving Problems with Software Coursera (Week 2).

Enroll Here: Java Programming: Solving Problems with Software – Coursera

Course overview ( All weeks quizzes answers link )

  • Week 1: Java Programming: Solving Problems with Software Coursera Quiz answers

Week 2: Java Programming: Solving Problems with Software Coursera Quiz answers

  • Week 3: Java Programming: Solving Problems with Software Coursera Quiz answers
  • Week 4: Java Programming: Solving Problems with Software Coursera Quiz answers

Now, let’s start with Week 2 quiz answers which is a part o f Java Programming: Solving Problems with Software

Below you’ll find all practice quiz answers of different topics/sections in Java Programming: Solving Problems with Software Coursera Quiz answers and end quiz exam answers under week 2.

Practice Quiz: Finding a Gene in DNA Quiz Answers Coursera – 6 questions

Q1. Consider the assignment that goes with this lesson and its algorithm for finding a gene with stop codon TAA.

Consider the following DNA string.

  • “AAATGCCCTAACTAGATTAAGAAACC”

Which one of the following is the gene returned using that algorithm?

a) ATGCCCTAACTAGATTAA b) ATGCCC c) ATGCCCTAA d) The empty string e) CCC

Answer: c) ATGCCCTAA

Q2. Which one of the following replaces the String variable dna with the lowercase version of this string?

a) dna = dna.toLowerCase(); b) dna.toLowerCase() = dna; c) dna.toLowerCase(); d) The empty string e) dna = dna.toLowerCase(dna);

Answer: a) dna = dna.toLowerCase();

Q3. After adding two additional parameters to findSimpleGene for the startCodon and stopCodon, which of the following is another change that must be made for the program to compile?

a) Two arguments must be added to the call to findSimpleGene. b) Two if statements must be added to findSimpleGene. c) Two return statements must be added to findSimpleGene d) Two if statements must be added to testSimpleGene

Answer: a) Two arguments must be added to the call to findSimpleGene.

Q4. Suppose that stringa is in stringb at position pos. Which one of the following returns the part of stringb that comes after stringa in the method lastPart?

a) return stringb.substring(pos+stringa.length()); b) return stringb.substring(pos); c) return stringb.substring(pos, stringa.length()); d) return stringb – stringa;

Answer: a) return stringb.substring(pos+stringa.length());

Q5. In the method twoOccurrences, suppose pos is the value of the first occurrence of stringa when stringa is found. Which of the following lines of code assigns pos2 to the second occurrence of stringa if there is a second occurrence?

a) pos2 = stringb.indexOf(stringa, pos+1); b) pos2 = stringb.indexOf(stringa); c) pos2 = stringb.indexOf(stringa, pos); d) pos2 = indexOf(stringb, stringa, pos);

Answer: a) pos2 = stringb.indexOf(stringa,pos+1);

Q6. Consider assignment 2 for this lesson. Consider the code to find and print all the YouTube URL links.

Practice Quiz: Finding All Genes in DNA Q uiz Answers Coursera – 4 questions

Q1. Which one of the following is the first gene for this strand of DNA where you want to consider all three of the stop codons?

“AATGCTAACTAGCTGACTAAT”

a) The empty string b) CTAACTAGC c) ATGCTA d) ATGCTAACTAGCTGA e) ATGCTAACTAG f) ATGCTAA

Answer: d) ATGCTAACTAGCTGA

Q2. Consider the following code segment to count the number of times the string “TG” occurs in the string dna, that does not work correctly.

a) The two lines in the body of the while loop should be swapped so the count happens after pos is given a new value. b) Each time pos is reset in the while loop it finds the same “TG”. c) The count is off by 1. The count should be initialized to 1 to take into account the first “TG” that is found. d) The variable pos should be initialized to 0 in line 2 and only set with indexOf inside the while loop.

Answer: b) Each time pos is reset in the while loop it finds the same “TG”.

Q3. Consider the following segment of code from a program.

How many different ways are there to break out of this loop?

a) 2 b) 0, it is an infinite loop c) 1 d) 3

Answer: a) 2

Q4. Which one of the following conditionals correctly evaluates to true if the integer num is an odd number and to false if it is an even number.

a) if (num % 2 == 1) b) if (num % 2 == 0) c) if (num % 2 == (num+1) % 2) d) if (num % 2 == num % 2)

Answer: a) if (num % 2 == 1)

Practice Quiz: Debugging Part 1 Q uiz Answers Coursera – 12 questions

Solution Link – Click here!

Practice Quiz: Debugging Part 2 Q uiz Answers Coursera – 11 questions

Practice quiz: using storageresource q uiz answers coursera – 6 questions.

Q1. How many genes are there in the file brca1line.fa?

Q2. How many genes are there in the file brca1line.fa that are longer than 60?

Q3. How many genes are there in the file brca1line.fa that have a C-G-ratio greater than 0.35?

Q4. If dna is a String and cgcount is the integer number of C’s and G’s in the String, which one of the following is the correct return statement to return the decimal number of the ratio of C’s and G’s in the string to the length of the string?

a) return double(countcg/dna.length()); b) return countcg / dna.length(); c) return ((double) countcg)/dna.length(); d) return double(countcg)/dna.length(); e) return (double) (countcg / dna.length());

Answer: c) return ((double) countcg)/dna.length();

Q5. Consider the following code where dna is a String. This code attempts to count the number of “C”’s in dna but has an error. It has forgotten to update the variable start.

Which one of the following best describes how to fix this error?

a) The code start = pos + 1; should go right before the line containing if (pos == -1) b) The code start = pos; should go immediately after the line containing countcg += 1; c) The code start = pos; should go right before the line containing if (pos == -1) . d) The code start = pos + 1; should go immediately after the line containing countcg += 1; e) The code start = pos – 1; should go right before the line containing if (pos == -1) . f) The code start = pos – 1 ; should go immediately after the line containing countcg += 1 .

Answer: d) The code start = pos + 1; should go immediately after the line containing countcg += 1;

Q6. Consider that storeAll is a method that returns a StorageResource of Strings. Which one of the following is a valid statement that would be useful in the storeAll method?

a) StorageResource store = storeAll(s); b) storeAll(s) = new StorageResource(); c) storeAll(s); d) String store = storeAll(s);

Answer: a) StorageResource store = storeAll(s);

Quizermania Logo

WEEK 2 QUIZ

Strings in java week 2 quiz answers coursera – 7 questions.

This is the end quiz of week 2 in Java Programming: Solving Problems with Software Coursera Quiz answers. It is necessary to complete with 80% or higher.

Q1. Consider finding all the YouTube links on a web page. What is the video for the second YouTube link on the web page http://www.dukelearntoprogram.com/course2/data/manylinks.html about?

a) Turkeys, Ducks and Quails b) STEM c) Walt Disney cartoons d) Potatoes

Answer: a) Turkeys, Ducks and Quails

Q2. Consider the following mystery method.

Which of the following best describes what it does?

a) The method mystery is given a string and it returns a string which is three copies of the original string. b) The method mystery is given a string and it returns a string which is the same string but with the each T each replaced with two T’s. c) The method mystery is given a string and it returns a string which is the same string but with the first three T’s removed. d) The method mystery is given a string and it returns a string which is the same string but with the first three T’s each replaced with two T’s. e) The method mystery is given a string and it returns a string which is the same string but with all the T’s removed.

Answer: c) The method mystery is given a string and it returns a string which is the same string but with the first three T’s removed.

Q3. Use the following data file to answer this question: http://www.cs.duke.edu/~rodger/GRch38dnapart.fa. How many genes are in this file?

Q4. Use the following data file to answer this question: http://www.cs.duke.edu/~rodger/GRch38dnapart.fa. How many genes in this file are longer than 60?

Q5. Use the following data file to answer this question: http://www.cs.duke.edu/~rodger/GRch38dnapart.fa. How many genes in this file have cgRatio greater than 0.35?

Solving Problems with Software Coursera Week 2 Quiz answers

Q6. Use the following data file to answer this question which represents one long strand of DNA: http://www.cs.duke.edu/~rodger/GRch38dnapart.fa. How many times does the codon CTG appear in this strand of DNA?

Answer: 224

Q7. Use the following data file to answer this question: http://www.cs.duke.edu/~rodger/GRch38dnapart.fa. What is the length of the longest gene in the collection of genes found in this file?

Answer: 489

>> Next: WEEK 3: Java Programming: Solving Problems with Software Coursera Quiz answers

Explore! Artificial Intelligence Foundations Exams answers – SkillUp

The above question set contains all the correct answers. But in any case, you find any typographical, grammatical or any other error then kindly inform us.

Thanks in advance.

If you need answers of any exam then let me know through contact us page.

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Related Posts

Introduction to cybersecurity tools & cyber attacks quiz answers coursera, introduction to cybersecurity tools & cyber attacks week 2 quiz answers coursera, introduction to cybersecurity tools & cyber attacks week 3 quiz answers coursera, introduction to cybersecurity tools & cyber attacks week 4 quiz answers coursera, java programming: solving problems with software coursera quiz answers, java programming: solving problems with software coursera week 3 quiz answers, leave a comment cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

  • 1st Central Law Reviews: Expert Legal Analysis & Insights

Category: Coursera

Data structures and performance | week 6, data structures and performance | week 5, data structures and performance | week 4, data structures and performance | week 3, data structures and performance | week 2, data structures and performance | week 1, algorithmic toolbox | week 6, algorithmic toolbox | week 5, algorithmic toolbox | week 4, algorithmic toolbox | week 3.

Logo

Java Programming: Solving Problems with Software Quiz Answers 2024

Table of contents, java programming: solving problems with software week 1 quiz answers, quiz:getting started with bluej.

Which one of the following best describes what you need to do in order to run the program?

Q 2. Which one of the following best describes what happens when one compiles a Java program in BlueJ on their computer?

Quiz:Variables and Mathematical Operators

Q 2. Consider the following Java statements.

Quiz:Functions and Conditionals

Consider the following Java methods.

Q 1. Consider the following method play , and assume appropriate import statements are there for classes used in this function.

What is (or are) the instance variable(s) in this class?

And consider the following code segment that uses the class Thing.

Q 4. Consider the following code segment that uses the edu.duke FileResource class. The method .length() calculates how many characters are inside a string. For example, for the string “puppy”, .length() would calculate a value of 5. We will learn more about strings later in this course.

Suppose the file words.txt contains the following lines:

Hint: Be sure to review the documentation for FileResource if you do are not sure what this class does or what methods it contains: http://www.dukelearntoprogram.com/course2/doc/ .

And consider the following code segment that uses the Thing class.

Quiz: Calculating the Perimeter of a Shape

Q1. What is the perimeter of the shape made from the file datatest4.txt whose contents are shown below (Truncate your answer to two decimal places)?

Q3. What is the longest side in the shape made from the file datatest4.txt whose contents are shown below (Truncate your answer to two decimal places)?

Q6. The method getNumPoints returns the number of points in a Shape s.

Java Programming: Solving Problems with Software Week 2 Quiz Answers

Finding a gene in dna.

Which one of the following is the gene returned using that algorithm?

Q 4. Suppose that stringa is in stringb at position pos. Which one of the following returns the part of stringb that comes after stringa in the method lastPart?

Which one of the following is the missing code to find and print all the YouTube URLs?

Quiz:Finding All Genes in DNA

Q 4. Which one of the following conditionals correctly evaluates to true if the integer num is an odd number and to false if it is an even number.

Quiz:Debugging: Part 1

You friend has just finished writing a solution and needs help testing it.

Do this example by hand. What should the output be if the method is working correctly?

What should the output be if the method is working correctly?

Q 6. What is the index that is out of range?

Enter your answer as numbers separated by a comma: int1, int2. For example if index+1 were 1 and index+4 were 5, you would enter:

Q 10. Imagine your friend wants to get help from Coursera classmates on the discussion forums.

Q 11. Which of the following are examples of input that would also throw this exception? Check all that are correct.

Q 12. Add an if statement, such that the while loop breaks if the index is out of bounds. Compile the code and run it again. It should now print “bcd” without throwing an exception. Try it on the examples you selected the previous question to make sure it works.

What are possible conditions for this if statement? (Choose all that are correct.)

Quiz:Debugging: Part 2

Q 1. You have fixed one bug in your friend’s code, so that it no longer throws an index out of bounds exception, by adding the condition index >= input.length() – 3:

Let’s test some more. Run the above code with input “abcdkfjsksioehgjfhsdjfhksdfhuwabcabcajfieowj”. What is the output?

Q 2. Check this answer – do the problem by hand. What should be the correct output for input “abcdkfjsksioehgjfhsdjfhksdfhuwabcabcajfieowj”?

bcd,bca,bca

Q 4. You can see that the program is finding the first two occurrences of “abc” but not the third. The while loop is breaking without finding this occurrence. So we know that when the variable index is updated after finding the second occurrence of “abc” at index 30, it must be updated either to -1 or to something greater than or equal to the length of input – 3. Let’s see which it is.

Q 5. Now we can tell that the code isn’t finding the last occurrence of “abc” even though we can see that a third occurrence exists. At what index should the third occurrence of “abc” be found?

Q 8. Imagine your friend wants to get help from Coursera classmates on the discussion forums. Which of the following would be the most helpful way to describe the problem so that others can easily help?

Enter your answer with the printed strings separated by commas, str1, str2. For example, if the output were “bcq”, “bcd”, and “bcu”, you would write: bcq, bcd, bcu

note: if you know the answer please comments

Quiz: Using StorageResource

Q 3. How many genes are there in the file brca1line.fa that have a C-G-ratio greater than 0.35?

Which one of the following best describes how to fix this error?

Quiz: Strings in Java

Java programming: solving problems with software week 3 quiz answers, quiz: which countries export….

Answer: European Union.

Quiz: Weather Data

Quiz: csv files and basic statistics in java.

Q3. Run your program developed in  Parsing Weather Data  to determine the lowest humidity in the file for June 29th, 2014 ( weather-2014-06-29.csv ).

Java Programming: Solving Problems with Software Week 4 Quiz Answers

Quiz: baby names, batch grayscale images.

The code below has been started for you. The variable f is a file of an image and the method makeGray returns an image that is the grayscale image of the original image.

Suppose we have a Pixel named pxInvert and a Pixel named pxOriginal .

What is the name of the resulting file?

inv-dragon.png

Get all Course Quiz Answers of Object Oriented Programming in Java Specialization

Team networking funda, related posts, client needs and software requirements coursera quiz answers.

Introduction to Software Product Management Coursera Quiz Answers

Introduction to Software Product Management Coursera Quiz Answers

Introduction to Test Driven Development (TDD) Quiz Answers

Introduction to Test Driven Development (TDD) Quiz Answers

Leave a reply cancel reply, trending now.

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

These are my notes to Meta's Programming with Javascript course on Coursea with the answers to all the interactive Javascript exercises.

MatthewBleUK/meta-coursera-programming-with-javascript

Folders and files.

NameName
11 Commits

Repository files navigation

Meta coursera - programming with javascript.

This course covers a basic to intermediate Javascript topics including: variables, data types, conditional statements, loops, object methods, error handling and prevention, defensive programming, DOM manipulation, functional and OOP paradigms, recursion, scope, and unit testing with Jest.

  • JavaScript 98.6%

IMAGES

  1. Coursera Answers: Java Programming Solving Problem with Software

    coursera java assignment answers

  2. Object Oriented Programming in Java Coursera Week 6 Answers

    coursera java assignment answers

  3. Coursera: Introduction to Java by LEARNQUEST

    coursera java assignment answers

  4. Coursera: Java Programming Solving Problems With Software Answers

    coursera java assignment answers

  5. Coursera

    coursera java assignment answers

  6. JAVA FOR ANDROID// Week 2 & 3 Programming Assignment answer &Process /#Coursera / 2021 /100%correct

    coursera java assignment answers

COMMENTS

  1. Java Programming: Solving Problems with Software, week(1-4 ...

    course link: https://www.coursera.org/learn/java-programming?Friends support me to give you more useful videos.Subscribe me and comment me whatever courses y...

  2. coursera-assignment · GitHub Topics · GitHub

    Notes, programming assignments and quizzes from all courses within the Coursera Deep Learning specialization offered by deeplearning.ai: (i) Neural Networks and Deep Learning; (ii) Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization; (iii) Structuring Machine Learning Projects; (iv) Convolutional Neural ...

  3. Coursera: Introduction to Object-Oriented Programming with Java by

    Coursera: Core Java Specialization | LEARNQUESTCourse 2 - Introduction to Object-Oriented Programming with JavaWeek 1 - Practice Quiz 1 ...

  4. Coursera: Introduction to Java by LEARNQUEST

    Coursera: Core Java Specialization | LEARNQUESTCourse 1 - Introduction to JavaWeek 1 - Practice Quiz Quiz: Module 1 Review-----...

  5. Java Programming: Solving Problems with Software

    There are 5 modules in this course. Learn to code in Java and improve your programming and problem-solving skills. You will learn to design algorithms as well as develop and debug programs. Using custom open-source classes, you will write programs that access and transform images, websites, and other types of data.

  6. Java Programming and Software Engineering Fundamentals ...

    After completing this course you will be able to: 1. Edit, compile, and run a Java program; 2. Use conditionals and loops in a Java program; 3. Use Java API documentation in writing programs. 4. Debug a Java program using the scientific method; 5. Write a Java method to solve a specific problem; 6.

  7. Object Oriented Programming in Java

    Course Opening Title • 0 minutes • Preview module. Welcome (Object Oriented Java Programming: Data Structures and Beyond Specialization) • 3 minutes. Welcome (Object Oriented Programming in Java Specialization) • 1 minute. Project prototype • 4 minutes. Your Path through the Course • 5 minutes.

  8. coursera-solutions · GitHub Topics · GitHub

    All 30 Jupyter Notebook 11 Java 2 JavaScript 2 MATLAB 2 Python 2 HTML 1 Shell 1. ... coursera quiz genes command-line-tool genomic coursera-course gen coursera-assignment genomics-data coursera-solutions coursera-assignment-solution course-answers coursera-answers Updated Aug 6, 2023; bomcon123456 / AlgorithmPart1 Star 5.

  9. GitHub

    Solutions to the Assignments for the Algorithmic Toolbox course offered by UCSanDiego on Coursera. - prantosky/coursera-algorithmic-toolbox

  10. Coursera: Java Programming Solving Problems With Software Answers

    Coursera: Java Programming Solving Problems With Software Answers | Week [ 1 to 4 ] Quiz Answers Java Programming Coursera Quiz AnswersJava Programming Solvi...

  11. Introduction to Java and Object-Oriented Programming

    This first module provides an introduction to the Java language and object-oriented programming. It includes an overview of Java syntax, in particular, how it differs from a language like Python. Topics will include variables and data types, loops and conditionals, printing to the console, scanning for user input, and code documentation.

  12. Java Programming: Solving Problems with Software Coursera Week 2 Quiz

    a) The two lines in the body of the while loop should be swapped so the count happens after pos is given a new value. b) Each time pos is reset in the while loop it finds the same "TG". c) The count is off by 1. The count should be initialized to 1 to take into account the first "TG" that is found.

  13. coursera-assignment-solution · GitHub Topics · GitHub

    To associate your repository with the coursera-assignment-solution topic, visit your repo's landing page and select "manage topics." GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

  14. Java For Android Week 1 Coursera Quiz Answers And Assignments Solution

    A Java interface cannot be instantiated directly, whereas a class can. A Java class is a data abstraction mechanism, whereas a Java interface is a control abstraction mechanism. A Java interface provides a subset of the features provided by a Java class. These are answers of Java for Android Week 1 Coursera course. 5. Question 5

  15. Object Oriented Programming in Java Specialization

    After completing this course, you will be able to: 1. Read and write data from/to files; 2. Solve problems involving data files; 3. Perform quantitative analyses of data (e.g., finding maximums, minimums, averages); 4. Store and manipulate data in an array or ArrayList; 5. Combine multiple classes to solve larger problems; 6.

  16. Coursera Quiz, Assignments, Exam & Guided Projects Solutions

    Get your Coursera quiz, exam, assignment and guided projects solutions and answers by progiez. Get your peer grade assignment done by progiez. ... Home Nptel Assignment Answers 2024. Coursera. Java for Android | Coursera.

  17. Object Oriented Programming in Java Coursera Quiz Answers

    Get all Course Quiz Answers of Object Oriented Programming in Java Specialization. Course 01: Java Programming: Solving Problems with Software Quiz Answers. Course 02: Java Programming: Arrays, Lists, and Structured Data Quiz Answers. Course 03: Object Oriented Programming in Java Quiz Answers.

  18. Sonia-96/Coursera-Data_Structures_and_Algorithms

    My solutions to assignments of Data structures and algorithms (by UCSD and HSE) on Coursera. All problems from Course 1 to Course 5 have been solved. - Sonia-96/Coursera-Data_Structures_and_Algorithms

  19. Java Programming: Arrays, Lists, and Structured Data

    Use these data structures to build more complex programs that use Java's object-oriented features. At the end of the course you will write an encryption program and a program to break your encryption algorithm. After completing this course, you will be able to: 1. Read and write data from/to files; 2. Solve problems involving data files; 3.

  20. Java Programming: Solving Problems with Software Quiz Answers 2024

    The function computes the sum of those points from the Shape s that have a positive X and a negative Y. Java Programming: Solving Problems with Software Week 2 Quiz Answers. Finding a Gene in DNA. Q 1. Consider the assignment that goes with this lesson and its algorithm for finding a gene with stop codon TAA.

  21. Coursera-Data_Structures_and_Algorithms

    This repository contains my solutions to the Data Structures and Algorithms assignments offered by the University of California, San Diego (UCSD) and the National Research University Higher School of Economics (HSE) on Coursera. All of the problems from courses 1 through 6 have been solved using Python. These solutions are intended to serve as a reference for those working on these assignments ...

  22. Core Java Specialization [4 courses] (LearnQuest)

    In the four courses of this specialization, you'll quickly master the Java programming language and the packages that constitute its rich set of core libraries. We'll provide hands-on exercises so you can practice your new skills. In Course 1, we'll introduce you to the basic fundamentals of the Java language.

  23. MatthewBleUK/meta-coursera-programming-with-javascript

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window.