Write a complete java method called checkpassword

Assignment Help JAVA Programming
Reference no: EM13945336

Part 1 - Methods - You will simply just write methods as the questions ask you to.

1. Write a complete Java method called sumNums that takes no parameters and returns an integer. The method uses a do-while loop to ask the user to enter a series of positive integer values and keeps a running total. Use a sentinel (-1) to allow the user to indicate when they are finished. The method returns the total.

2. Write a complete Java method called checkPassword that takes a String as a parameter (password) and returns a boolean. First, check that the password is at least 8 characters long. Then use a while loop to check that the password contains at least one digit. If the password has the correct length and contains a digit, return true, otherwise return false

3. Write a complete Java method called authenticate that takes two Strings (username, password) as parameters and returns a boolean. If the username parameter has the value "Chucky" and the password parameter has the value "Cheese1", return true. Otherwise return false.

4. Write a complete Java method called getScoreSheet that takes two ints as parameters (rows and columns) and constructs a 2-dimensional array of doubles (calles scores) with a size based on the rows and columns parameters. Use a nested loop to initialize each value in the array to 100.00. The method returns the scores array.

5. Write a complete Java method called writeList that takes an ArrayList of Strings as a parameter and writes each String as a line in a text file. Make sure to handle the Exception that might be thrown and print the error message to the command line.

Part 2 - Complete JAVA Program - You will write a complete JAVA program as requested below.

Write a complete Java program to compute the cost of your annual coffee consumption. (If you don't drink coffee, you can substitute tea, soda, or something else.)

The main method calls three methods to do this:

getDailyCost: requests from the user the estimated amount they spend on coffee on each day of the week, Sunday through Saturday. These values are stored in array of 7 doubles called dailyCost. The method returns this array.

getAnnualCost: takes an array of doubles as a parameter (the dailyCost array) and computes the annual cost for coffee (or tea, soda, etc).

Assume 52 weeks in a year. The method returns the annual cost as a double.

printAnnualCost: takes a double (the annual cost) as a parameter and prints it to the command line as, for example: "Your estimated total meal plan cost is: $1375.00."

Reference no: EM13945336

Questions Cloud

Firm has target debt–equity ratio : Scanlin, Inc., is considering a project that will result in initial aftertax cash savings of $1.87 million at the end of the first year, and these savings will grow at a rate of 1 percent per year indefinitely. The firm has a target debt–equity ratio..
Compare and contrast proprietary fund reporting : Examine why GASB requires the direct method for cash flow statements in the proprietary funds instead of allowing the direct or indirect method.
What sequence of events created the secure connection : The retailer asks for your credit card number. Before you transfer your credit card number, the browser enters a secure connection. What sequence of events created the secure connection?
Issued a bond with ten years to maturity : Jiminy’s Cricket Farm issued a bond with 10 years to maturity and a semiannual coupon rate of 8 percent 3 years ago. The bond currently sells for 96 percent of its face value. The company’s tax rate is 35 percent. What is the pretax cost of debt? Wha..
Write a complete java method called checkpassword : Write a complete Java method called checkPassword that takes a String as a parameter (password) and returns a boolean. First, check that the password is at least 8 characters long.
Estimate the total cost for the project : Estimate the costs for the resources, and add the costs to the resource information in the Microsoft Project file. Estimate the total cost for the project, using the Microsoft® Project budget or cost reports
Find several research articles, papers and presentations : Find several research articles, papers, presentations, online materials etc that is related to the use/application of hypermedia in the content area of your interest.
How might apply to personal, practical, and ministry work : How might I go about discerning the Providence of God and that the Open model or view with regards to love is unbiblical? How might I apply this to my personal, practical, and ministry work?
Describe access from my pc to where they hook up to the isp : For DSL, you should describe the solution from my PC to the DSLAM or the first ATM switch. For cable or wireless, you should describe access from my PC to where they hook up to the ISP.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java program to decide whether integer is perfect number

For example, 6 is a perfect number because 6 = 1 + 2 + 3. Write a Java program that decides whether integer is a perfect number.

  Implement a class student

Implement a class Student. For the purpose of this exercise, a student has a name and a total quiz score. Supply a suitable constructor and methods getName( ), addQuiz(int score), getTotalScore( ), and getAverageScore ( ).

  Output the number of vowels

Prompt the user to enter a string, and using a loop, count and output the number of vowels, and consonants the string contains. (You have to find methods from class.)

  Write a jsp webpages ask the user to enter data

Write a jsp webpages ask the user to enter the following data- First name, Last name

  Create java applet to input miles driven and gallons used

Create the Java applet which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display miles per gallon obtained for each tankful.

  Creates a list of shapes stored in an array

Identify and use the correct syntax of a common programming language (Java) - describe program functionality based on analysis of a given program;

  Drags html list items to and from a javascript array

1.Write a program which drags html list items to and from a javascript array.2. if an identical list item is already in the array, prevent the list item from dropping in the array. Give an error saying that the list item already exists in the array

  Function that finds the smallest item in an arraybag

Write me a function that finds the smallest item in an ArrayBag (by reference) and returns true if the arrayBag is not empty and false otherwise.

  Write a java program to simulate a die

Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the Math.Random() or the java.util.Random() class to generate the values on the die.

  Live nodes and garbage collection in java

For a list with n Nodes, what is the maximum number of nodes that are "live" (i.e., accessible from a "root set" of variables) during the method inverse(), and when does this maximum occur?

  Create a gantt chart for the project

Create a Gantt chart for the project. Compare and contrast the information that one receives from a Gantt chart, versus that of a PERT diagram

  Please write the code in java nbsprecursionimplement a

please write the code in java nbsprecursionimplement a subsetgenerator that generates all subsets of the characters of

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd