Skip to content

ETCappy/Ch6Lab6_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ch6Lab6_2

Prob 1 Beginning on slide 23 of Chapter 6 Methods Part 1 there is a problem with two methods. Type the problem and run it.

Prob2 Write a method that takes a parameter for the number of a month and prints the month's name. You may assume that the actual parameter value passed to the method is always between 1 and 12 inclusive.

This method must be called monthName() and it must have an integer parameter.

Calling monthName(8) should print August to the screen.

Call your method in the program's main method.

Prob3 Write a method named swap that takes an int parameter followed by a double and prints them in the reverse order. For example, calling swap(4, 7.5) would print 7.5 4.

Call your method in the program's main method.

Prob4 Write a method that takes 5 ints as parameters and returns the average value of the 5 ints as a double.

This method must be named average() and it must have 5 int parameters. This method must return a double.

Calling average(1, 5, 7, 4, 10) would return 5.4.

Call your method in the program's main method.

Prob5 Type the Method Overloading problem into Prob5 and run it. Answer the questions by using /* and */ for comments

What is method overloading 2. What are the overloaded methods in this problem and how are they able to be run successfully? image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published