Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
CSE 12X Self-Placement Attention! This tool is still under development. All content, including course recommendations, is subject to change. Welcome to the CSE 12X Guided Self-Placement! We're excited that you are interested in taking an introductory computer science course! Our CSE 121, 122 and 123 programming courses are designed for all students, regardless of how much prior experience you do or do not have and regardless of your goals or reasons for taking the course. In that spirit, we want everyone to take the right first course for them, especially since prior experience can come in many different forms. This self-placement will help you find that course. If you have never programmed before, or if your programming experience is limited, you will probably begin with CSE 121, which is designed for students with no previous experience whatsoever. If you took a high-school programming course intended to be similar to a first college course, like AP Computer Science A or IB Computer Science, you will probably start with CSE 122. If you have substantial previous experience you might even want to enroll in CSE 123. This guided self-placement will help you make this decision by asking you questions about your background. These will include questions about the specific courses and experience you have, how familiar you are with various topics and concepts, and how comfortable you are solving practice problems. We hope this will help most people pick the right course for them, but if you still have questions at the end, you can always contact our helpful undergraduate advising team for more support. This self-placement is adaptive, meaning which questions you see and in which order will depend on your responses. So each student will have a slightly different experience, and if you go back and change your answers, you may see different questions appear. This is to help make sure we get the information that will most help us recommend the best course for you. As you go through the self-placement, you may also encounter terms or concepts you haven't heard of before. Don't be intimidated-- if you haven't seen a topic or concept, that just means you should probably be in the course that teaches it! We encourage you to answer all questions as truthfully as possible based on your current experience. When you're ready, click the button below to begin. Begin Self-Assessment Have you taken a previous computer science course? Yes No Do you have previous programming experience outside of a course? Yes No What is the most recent computer science course you have completed? Select an option CSE 142 (at UW, UW in the High School, or a community college) Advanced Placement (AP) Computer Science A Advanced Placement (AP) Computer Science Principles International Baccalaureate (IB) Computer Science - Standard Level (SL) International Baccalaureate (IB) Computer Science - High Level (SL) Exploring Computer Science Other What was your grade in CSE 142? 0.0-0.9 1.0-1.9 2.0-2.9 3.0-4.0 S NS I do not have a grade in CSE 142 What was your score on the AP Computer Science A exam? 1 2 3 4 5 I did not take the exam or do not have a score What was your score on the IB Computer Science exam? 1 2 3 4 5 6 7 I did not take the exam or do not have a score How familiar and comfortable are you with each of the following programming topics/constructs? Variables and assignment statements Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Data types (e.g., int, double, String, char) Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Functions and/or methods Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Loops Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Conditionals (e.g., if, else) Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Arrays and/or lists Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Read and work on this problem, then answer the next question: What is the output after executing the following code? Java Python public class Example { public static void main(String[] args) { figure(8); } public static void figure(int max) { for (int line = 1; line <= max; line++) { for (int dots = 1; dots <= -1 * line + max; dots++) { System.out.print("."); } System.out.println(line); } } } Toggle solution .......1 ......2 .....3 ....4 ...5 ..6 .7 8 def figure(max_num): for line in range(1, max_num + 1): for dots in range(1, max_num - line + 1): print(".", end="") print(line) figure(8) Toggle solution .......1 ......2 .....3 ....4 ...5 ..6 .7 8 Which of the following best describes your experience with the preceding problem? I did not understand the problem or did not know how to begin solving it. I was able to begin solving the problem but got stuck. I was able to complete the problem but struggled greatly. I was able to solve the problem with a little difficulty. I was able to solve the problem with no difficulty. Read and work on this problem, then answer the next question: What is the output after executing the following code? Java Python public class Example { public static void main(String[] args) { String[] list = {"hello", "banana", "lime", "lemon", "apple", "strawberry", "grape"}; boolean mystery1 = mystery(3, list); System.out.println("Mystery 1: " + mystery1); boolean mystery2 = mystery(5, list); System.out.println("Mystery 2: " + mystery2); } public static boolean mystery(int x, String[] list) { for (int i = 0; i < list.length; i++) { if (list[i].length() < x) { return true; } } return false; } } Toggle solution Mystery 1: false Mystery 2: true def mystery(x, values): for el in values: if len(el) < x: return True return False values = ["hello", "banana", "lime", "lemon", "apple", "strawberry", "grape"] mystery1 = mystery(3, values) print("Mystery 1:", mystery1) mystery2 = mystery(5, values) print("Mystery 2:", mystery2) Toggle solution Mystery 1: False Mystery 2: True Which of the following best describes your experience with the preceding problem? I did not understand the problem or did not know how to begin solving it. I was able to begin solving the problem but got stuck. I was able to complete the problem but struggled greatly. I was able to solve the problem with a little difficulty. I was able to solve the problem with no difficulty. Read and work on this problem, then answer the next question: In one or two short sentences, describe what the following code does. Java Python import java.util.*; public class Example { public static void main(String[] args) { inputLoop(); } public static void inputLoop() { Scanner console = new Scanner(System.in); int totalChars = 0; String sentinel = "quit"; System.out.print("Type a word (or \"" + sentinel + "\" to quit): "); String word = console.next(); while (!word.equals(sentinel)) { totalChars += word.length(); System.out.print("Type a word (or \"" + sentinel + "\" to quit): "); word = console.next(); } System.out.println("The total number of characters is: " + totalChars); } } Toggle solution Reads in input from the user one word at a time until the word "quit" is entered, then prints the total number of characters entered (not including the word "quit"). def input_loop(): total_chars = 0; sentinel = "quit"; prompt = 'Type a word (or "' + sentinel +'" to quit): ' word = input(prompt) while word != sentinel: total_chars += len(word) word = input(prompt) print("The total number of characters is:", total_chars) input_loop() Toggle solution Reads in input from the user one word at a time until the word "quit" is entered, then prints the total number of characters entered (not including the word "quit"). Which of the following best describes your experience with the preceding problem? I did not understand the problem or did not know how to begin solving it. I was able to begin solving the problem but got stuck. I was able to complete the problem but struggled greatly. I was able to solve the problem with a little difficulty. I was able to solve the problem with no difficulty. How familiar and comfortable are you with each of the following programming topics/constructs? Console and/or file input and output Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Maps and/or dictionaries Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Defining classes Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Defining constructors Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Interfaces Select an option I have never heard of this. I have heard of this but don't know what it is or don't understand it. I know what this is but I am not comfortable using it in programming. I am somewhat comfortable using this in programming. I am entirely comfortable using this in programming. Read and work on this problem, then answer the next question: In one or two short sentences, describe what the following code does. Java Python public static Map> mystery(Map> map1) { Map> map2 = new HashMap<>(); for (String key : map1.keySet()) { Set set1 = map1.get(key); Set set2 = new HashSet(); for (int n : set1) { set2.add(n); } map2.put(key, set2); } return map2; } Toggle solution Creates a new map that contains the same keys and copies of the values of the parameter map. (Creates a deep copy of the parameter map.) def mystery(dict1): dict2 = {} for key in dict1: set2 = set() set1 = dict1[key] for n in set1: set2.add(n) dict2[key] = set2 return dict2 Toggle solution Creates a new dictionary that contains the same keys and copies of the values of the parameter dictionary. (Creates a deep copy of the parameter dictionary.) Which of the following best describes your experience with the preceding problem? I did not understand the problem or did not know how to begin solving it. I was able to begin solving the problem but got stuck. I was able to complete the problem but struggled greatly. I was able to solve the problem with a little difficulty. I was able to solve the problem with no difficulty. Read and work on this problem, then answer the next question: What is the output of the following code? class CreditCard { private String cardNumber; private String name; private double creditLimit; private double balance; private int totalCharges; public CreditCard(String name, String cardNumber, double creditLimit) { this.cardNumber = cardNumber; this.name = name; this.creditLimit = creditLimit; this.balance = 0; this.totalCharges = 0; } public void charge(double amount) { if (balance + amount > creditLimit) { throw new IllegalArgumentException("Beyond Credit Limit"); } balance += amount; totalCharges++; } public void payBill(double amount) { balance -= amount; } public String getPaymentType() { return "CC"; } public int totalPayments() { return totalCharges; } public String toString() { return getPaymentType() + " " + cardNumber + " (" + balance + ")"; } } public class Example5 { public static void main(String[] args) { CreditCard card1 = new CreditCard("Brett Wortzman", "1234567801019275", 1000); CreditCard card2 = new CreditCard("Zorah Fung", "9876543210108473", 500); card1.charge(325); card1.charge(400); card1.payBill(200); card2.charge(175); card2.payBill(50); card2.charge(75); card2.charge(100); System.out.println("Payment Method 1: " + card1); System.out.println("Payment Method 2: " + card2); System.out.println("Payment Method 1 charges: " + card1.totalPayments()); System.out.println("Payment Method 2 charges: " + card2.totalPayments()); } } Toggle solution Payment Method 1: CC 1234567801019275 (525.0) Payment Method 2: CC 9876543210108473 (300.0) Payment Method 1 charges: 2 Payment Method 2 charges: 3 Which of the following best describes your experience with the preceding problem? I did not understand the problem or did not know how to begin solving it. I was able to begin solving the problem but got stuck. I was able to complete the problem but struggled greatly. I was able to solve the problem with a little difficulty. I was able to solve the problem with no difficulty. Read and work on this problem, then answer the next question: In one or two short sentences, describe what the following code does. class CreditCard implements PaymentMethod { private String cardNumber; private String name; private double creditLimit; private double balance; private int totalCharges; public CreditCard(String name, String cardNumber, double creditLimit) { this.cardNumber = cardNumber; this.name = name; this.creditLimit = creditLimit; this.balance = 0; this.totalCharges = 0; } public void charge(double amount) { if (balance + amount > creditLimit) { throw new IllegalArgumentException("Beyond Credit Limit"); } balance += amount; totalCharges++; } public void payBill(double amount) { balance -= amount; } public String getPaymentType() { return "CC"; } public int totalPayments() { return totalCharges; } public String toString() { return getPaymentType() + " " + cardNumber + " (" + balance + ")"; } } class BankAccount implements PaymentMethod { private String number; private String name; private double balance; private int withdrawals; public BankAccount(String name, String number, int initialDeposit) { this.name = name; this.number = number; this.balance = initialDeposit; this.withdrawals = 0; } public void charge(double amount) { if (amount > balance) { throw new IllegalArgumentException("Insufficient Funds"); } balance -= amount; withdrawals++; } public void deposit(double amount) { balance += amount; } public String getPaymentType() { return "BankAccount"; } public int totalPayments() { return withdrawals; } public String toString() { return getPaymentType() + " " + number + " (" + balance + ")"; } } interface PaymentMethod { public void charge(double amount); public String getPaymentType(); public int totalPayments(); } public class Example6 { public static void main(String[] args) { CreditCard card1 = new CreditCard("Brett Wortzman", "1234567801019275", 1000); PaymentMethod method2 = new CreditCard("Zorah Fung", "9876543210108473", 500); PaymentMethod method3 = new BankAccount("Dubs", "1000000123467", 600); card1.charge(325); card1.charge(400); card1.payBill(200); method2.charge(175); method2.charge(75); method2.charge(100); method3.charge(150); System.out.println("Payment Method 1: " + card1); System.out.println("Payment Method 2: " + method2); System.out.println("Payment Method 3: " + method3); System.out.println("Payment Method 1 charges: " + card1.totalPayments()); System.out.println("Payment Method 2 charges: " + method2.totalPayments()); System.out.println("Payment Method 3 charges: " + method3.totalPayments()); } } Toggle solution Payment Method 1: CC 1234567801019275 (525.0) Payment Method 2: CC 9876543210108473 (300.0) Payment Method 3: BankAccount 1000000123467 (450.0) Payment Method 1 charges: 2 Payment Method 2 charges: 3 Payment Method 3 charges: 1 Which of the following best describes your experience with the preceding problem? I did not understand the problem or did not know how to begin solving it. I was able to begin solving the problem but got stuck. I was able to complete the problem but struggled greatly. I was able to solve the problem with a little difficulty. I was able to solve the problem with no difficulty. CSE 121 Since you don't have any previous programming experience, we recommend you take CSE 121. This course will start from the very beginning and will help you learn basic programming skills along with other students with limited experience. If you're more interested in using programming as a tool for data analysis and visualization, you might also want to consider CSE 160. This course also does not require any previous experience and focuses on using programming in Python to solve problems using data sets drawn from the sciences, engineering, business and the humanities. You can learn more about all of our introductory course options on the Allen School website. If you have any more questions, feel free to reach out to our undergraduate advising team. CSE 121 Although you have some previous programming experience, it sounds like you're still not entirely confident with some topics. We recommend you take CSE 121 to help you solidfy your understanding of that material before moving on to CSE 122. You can learn more about all of our introductory course options on the Allen School website. If you have any more questions, feel free to reach out to our undergraduate advising team. CSE 122 You seem to have a solid grasp of the basics, so we recommend you take CSE 122. This course will help you take the next step with your programming skills and learn to apply the concepts you already know in new and exciting ways. CSE 122 is taught in Java, but is designed for students with a wide range of previous experiences, so you should feel confident enrolling even if your experience is in another programming language. You can learn more about all of our introductory course options on the Allen School website. If you have any more questions, feel free to reach out to our undergraduate advising team. CSE 122 You seem to have a solid grasp of the basics, so we recommend you take CSE 122. This course will help you take the next step with your programming skills and learn to apply the concepts you already know in new and exciting ways. Since you previously took CSE 142, you may also want to consider enrolling in CSE 143, which is being offered a few more times. This course is the direct follow-up to CSE 142 and will more closely align with your experience having previously taken CSE 142. You can learn more about all of our introductory course options on the Allen School website. If you have any more questions, feel free to reach out to our undergraduate advising team. CSE 123 You have a lot of experience programming and have a strong understanding of some more advanced topics, so we recommend you take CSE 123. This course will teach you to use your existing programming skills to implement and manipulate complex data structures, and will also introduce some more advanced programming concepts. If you're more interested in using programming as a tool for data analysis and visualization, you might also want to consider CSE 163. This course builds on previous programming experience similarly to CSE 123, but with a focus on writing programs that manipulate and analyze different types of datasets. CSE 163 is taught in Python, but is designed to help students who have previously programmed in Java adapt, so you should feel confident enrolling even if you've never used Python before. You can learn more about all of our introductory course options on the Allen School website. If you have any more questions, feel free to reach out to our undergraduate advising team. Talk to Advising Based on your responses, there are multiple courses that might be a good fit for you. We recommend you speak with a member of undergraduate advising team so they can learn more about your situation and help you find the best fit.