EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Java代写
您的位置: 主页 > 编程案例 > Java代写 >
代写Java: case write a program computer science代写 - Java代写
发布时间:2021-07-25 20:43:21浏览次数:
You will write a program, TransferAdvisor.java, which asks the user for the school name, the major, and their GPA, and informs them whether their GPA is adequate for the school and major selected, or by how much they need to improve it. If a school or major is not in the spreadsheet, the user is informed. The school names and majors can be entered both as shown in the spreadsheet or in all lowercase letters. The “You need to improve your GPA by ### ” message should have 2 decimals precision for the GPA regardless of the student GPA entered. Below are a few runs of the program: Enter the school name: UCLA Enter the major: CSEnter your GPA: 3.457You need to improve your GPA by 0.24 to transfer to UCLA to study CS Enter the school name: ucsd Enter the major: english Enter your GPA: 3.12You could transfer to ucsd to study english Enter the school name: harvard Enter the major: CSEnter your GPA: 3.1harvard is not in the school system Enter the school name: ucla Enter the major: astrology Enter your GPA: 2.6There is no astrology major at ucla Hints:java代码代写– To avoid a lot of duplication with the code dealing with the GPA comparison and print outs, write a method that takes in the school name, the major name, the required GPA for that major in that school and the student GPA, and prints out either the “You could transfer …” or the “You need to improve your GPA by ”.– Avoid if/else if/ to match the school and the major. Switch/case makes the code cleaner. Part 2:Your boss has come to ask for your help with another task. She would like you to write asimple program that encodes and decodes “secret messages” which she plans to demonstrate to elementary school students to kindle their interest in Computer Science.The encoding/decoding scheme is very simple. Each letter is substituted by some other letter according to a given mapping as shown below.// String letters = abcdefghijklmnopqrstuvwxyz String enc = kngcadsxbvfhjtiumylzqropwe ;For example, every a becomes a k when encoding a text, and every k becomes an a when decoding. You will write a program, SecretMessage.java, which asks the user whether they would like to encode or decode a message, and then encodes or decodes the message using the mapping above.Capital letters are mapped the same way as the lower case letters above, but remain capitalized.For example, every A becomes K when encoding a text, and every K becomes an A when decoding. Numbers and other characters are not encoded and remain the same. The program repeatedly asks the user for input until the user quits. Below is one run of the program: Enter 1 to encode, 2 to decode, 3 to quit: 1 Enter the text to encode:Santa Monica College Spring 2014 Lktzk Jitbgk Gihhasa Luybts 2014Enter 1 to encode, 2 to decode, 3 to quit: 1 Enter the text to encode:programming is fun uyisykjjbts bl dqtEnter 1 to encode, 2 to decode, 3 to quit: 2 Enter the text to decode:Lktzk Jitbgk Gihhasa Luybts 2014 Santa Monica College Spring 2014Enter 1 to encode, 2 to decode, 3 to quit: 3 Good bye Hints:Think about decomposing the problem into simpler problems. You will likely find it helpful towrite a few very simple methods first:– isLowerCaseLetter takes a char and returns true if that letter is a lower case letter (between a and z ). isUpperCaseLetter and isLetter should work similarly.– toLowerCase takes an upper case letter and returns the same letter in lower case. Do not use conditionals to implement this (if/else or switch). Instead, remember that a char is “a number” code. Print that number code for A , B , a , b to see how it looks and come up with a very simple way to change an upper case letter to lower case. toUpperCase should work similarly.– codeChar takes a char and a boolean flag. If the flag is true, it returns the encoded char according to the given mapping. If the flag is false, it returns the decoded char according to the given mapping. Do not use conditionals to do the mapping. Instead, notice that the letter a is encoded to the first character of the given encoding map. The letter b to the second, and so on. For the decoding, you can write a decoding string by hand that you can use to map the encoded letters a to z to their decoded counterparts.Given a String in Java you can use the charAt method to get the letter at a given position. For example:String s = example ;char  first = s.charAt(0); // first is assigned  e char  second = s.charAt(1); // second is assigned  x Notice that to get the character at the first position we pass the argument 0 to the charAt method and not 1.– codeMessage takes a String and a boolean flag. If the flag is true, it prints the given message encoded. If the flag is false, it prints the given message decoded. This method just calls the codeChar method for every character in the String and prints the character that codeChar returns. It is really short and simple.Given a String in Java you can use the length method to get the number of characters in that String. For example:String s = hello ;int  len = s.length(); // len is assigned 5  Deliverables:You should submit a zip file named project1_first_last.zip (where first and last are your first and last name) containing ONLY the 2 files below. TransferAdvisor.java SecretMessage.java How you get points:– TransferAdvisor.java 40 points– SecretMessage.java 60 points How you lose points:– If your code does not follow Java coding standards regarding naming of classes, variables, methods, constants, etc.– If your code is not formatted properly and I find it hard to read.– If your code is not commented properly:– Every class file should have a header comment that includes your name and assignment number and briefly documents what the program does.– If there are known deficiencies with your program such as known problems or incomplete features, these should be clearly listed in the header comment.– Every method should have a method header comment that documents what the method does, what its parameters are, and what it returns.– Every complex block of code should have at least a line comment documenting that code s intent.– If your source code has print out statements you used for debugging or commented out code you used to try out ideas. Clean up your code before you submit. Do not leave clutter behind.最先出自315代写 cs代写 作业代写 java代写 代写java服务合作:315代写

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。