Giter VIP home page Giter VIP logo

watchtheory's Projects

audio-band icon audio-band

Display and control songs from the Windows taskbar

crude-oil-report icon crude-oil-report

This reports look at United States top exports ofr crude oil and on how much crude oil Texas produced in 2022.

mycroft-core icon mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.

sumoddrange icon sumoddrange

Write a method called isOdd with an int parameter and call it number. The method needs to return a boolean. Check that number is > 0, if it is not return false. If number is odd return true, otherwise return false. Write a second method called sumOdd that has 2 int parameters start and end, which represent a range of numbers. The method should use a for loop to sum all odd numbers in that range including the end and return the sum. It should call the method isOdd to check if each number is odd. The parameter end needs to be greater than or equal to start and both start and end parameters have to be greater than 0. If those conditions are not satisfied return -1 from the method to indicate invalid input. Example input/output: * sumOdd(1, 100); → should return 2500 * sumOdd(-1, 100); → should return -1 * sumOdd(100, 100); → should return 0 * sumOdd(100, -100); → should return -1 * sumOdd(100, 1000); → should return 247500 TIP: use the remainder operator to check if the number is odd NOTE: Both methods needs to be defined as public static like we have been doing so far in the course. NOTE: Do not add a main method to solution code.

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.