Giter Club home page Giter Club logo

cs.11.03-quiz.3.1's Introduction

CS.11.03-Quiz.3.1

Ensure that you read all instructions carefully. Do not include any additional methods that are not specified in this quiz description. Declare all methods as static. Good luck, have fun! :)

  1. Inside the Main class, complete the method calculateGrade. This method will take an integer argument and return a character that corresponds to the letter grade associated with a score.

90 and above = A

80 to 89 = B

70 to 79 = C

60 to 69 = D

50 to 59 = E

49 and below = F

calculateGrade(90); // Returns ‘A’

calculateGrade(79); // Returns ‘C’

  1. Inside the Main class, complete the method fizzBuzz. This method will take an integer argument and return a String depending on the divisibility of the argument passed. This method will return “fizz” if the value is divisible by 3, “buzz” if the value is divisible by 5, “fizzbuzz” if the value is divisible by both 3 and 5, and “unlucky” if the number is not divisible by 3 or 5.

fizzBuzz(3); // Returns “fizz”

fizzBuzz(5); // Returns “buzz”

fizzBuzz(15); // Returns “fizzbuzz”

fizzBuzz(16); // Returns “unlucky”

  1. Inside the Main class, complete the method frontBack. This method will take a String as an argument and return a String that has the first two characters of the original String passed added to the front and to the end of the original string. If the argument is less than two characters in length, return the argument.

frontBack(“hello”); // Returns “hehellohe”

frontBack(“hi”); // Returns “hihihi”

frontBack(“g”); // Returns “g”

  1. Inside the Main class, complete the method twoAsOne. This method will take three integers as arguments and return a boolean value depending on whether any two of the three integers can be added together to equal the third.

twoAsOne(1,2,3); // Returns true as 1+2=3

twoAsOne(4,11,-7); // Returns true as 11+-7=4

twoAsOne(4,6,12); // Returns false

  1. Inside the Main class, complete the method endUp. This method will take a String as an argument and return a String where the last three characters have been capitalized. If there are less than three characters in the argument, then capitalize all of the characters.

endUp(“hello”); // Returns “heLLO”

endUp(“for sure”); // Returns “for sURE”

endUp(“gg”); // returns “GG”

cs.11.03-quiz.3.1's People

Contributors

techarenz avatar momattpc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.