Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Question
Chapter 1, Problem 13RQ
Program Plan Intro
To find the components of method in C#.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
1. Create a project in NetBeans and name the project Hw06.
2. The class will contain the following static methods:
reverseS – A method that displays a string reversely on the console using the following signature:
publicstaticvoidreverseS(Strings)
printSub1 – print all substrings of a string
NOTE: duplicated substrings are allowed, but loops are not allowed
The method signature:
public static void printSub1(String s)
printSub2 – print all substrings of a string
NOTE: duplicated substrings are not allowed, but loops are allowed
The method signature:
public static void printSub2(String s)
Note: All methods should be RECURSIVE. Any predefined classes that are based on Set are not allowed.
In the main method, read a string from the user and output the reversed string and substrings to the screen:
Sample Run:
Please input a string: abcdThe reversed string: dcbaThe substrings of the input string: abcd abc ab a b bc b c bcd bc b c cd c d
The substrings of the input string: a ab abc abcd b…
Create an application via NetBeans with named Pizza that storesinformation about a single pizza. It should contain the following:• Private instance variables to store the size of the pizza (eithersmall, medium, or large), the number of cheese toppings, the number ofbeef toppings, and the number of chicken toppings.• Constructor(s) that set all of the instance variables.• Public methods to get and set the instance variables.• A public method named calcCost( ) that returns a double that is thecost of the pizza.Pizza cost is determined by:
Small: OR10 + OR 2 per topping
Medium: OR 12 + OR 2 per topping
Large: OR 14 + OR 2 per topping• A public method named getDescription( ) that returns a Stringcontaining the pizza size, quantity of each topping, and the pizzacost as calculated by calcCost( ).
In Java
Given the following CircleDriver.java file. Provide an accompanying Circle.javafile. Specifically, your Circle class should contain:• One instance variable – radius• A method named setRadius that assigns the passed-in radius value to the radiusinstance variable.• A method named initialize that prompts the user for a radius value and thenassigns the entered value to the radius instance variable.• A method named printCircleData that uses the circle’s radius to calculate thecircle’s diameter, circumference, and area. Use the Java API constant Math.PIfor the value of π. Print the circle’s radius, diameter, circumference, and area. Thereare many ways to implement printCircleData. In the interest of gainingexperience with local variables, declare and use local variables for storing thecircle’s diameter, circumference, and area.
The Driver:/***************************************************** CircleDriver.java** This is the driver for the Circle…
Chapter 1 Solutions
Microsoft Visual C#
Ch. 1 - Programming languages such as C#, Java, and Visual...Ch. 1 - Prob. 2RQCh. 1 - The grammar and spelling rules of a programming...Ch. 1 - Prob. 4RQCh. 1 - Programs in which you create and use objects that...Ch. 1 - Prob. 6RQCh. 1 - The technique of packaging an objects attributes...Ch. 1 - Of the following languages, which is least similar...Ch. 1 - Prob. 9RQCh. 1 - The C# method that produces a line of output on...
Ch. 1 - Prob. 11RQCh. 1 - Prob. 12RQCh. 1 - Prob. 13RQCh. 1 - Prob. 14RQCh. 1 - Prob. 15RQCh. 1 - Prob. 16RQCh. 1 - The text of a program you write is called...Ch. 1 - Prob. 18RQCh. 1 - Prob. 19RQCh. 1 - Prob. 20RQCh. 1 - Indicate whether each of the following C#...Ch. 1 - Name at least three attributes that might be...Ch. 1 - Prob. 3ECh. 1 - Prob. 4ECh. 1 - Prob. 5ECh. 1 - Prob. 6ECh. 1 - Prob. 7ECh. 1 - Write a program named BigLetter that displays a...Ch. 1 - From 1925 through 1963, Burma Shave advertising...Ch. 1 - Each of the following files in the Chapter.01...Ch. 1 - The case problems in this section introduce two...Ch. 1 - The case problems in this section introduce two...
Knowledge Booster
Similar questions
Create an application class named LetterDemo that instantiates objects of two classes named Letter and CertifiedLetter and that demonstrates all their methods. The classes are used by a company to keep track of letters they mail to clients. The Letter class includes auto-implemented properties for the name of the recipient and the date mailed. Also, include a ToString() method that overrides the Object classs ToString() method and returns a string that contains the name of the class (using CetType and the Letters data field values. Create a child class named CertifiedLetter that includes an auto-implemented property that holds a tracking number for the letter.
arrow_forward
Create a program named SalesLetter whose Mai n method uses several WriteLine() calls to display a sales letter to prospective clients for a business of your choice. Display your contact information at least three times in the letter. The contact information should contain at least three lines with data such as land line phone number, cellphone number, email address, and so on. Each time you want to display the contact information, call a method named DisplayContactInfo().
arrow_forward
In Form1:
Create a List of Employees
Define a method preloadEmployeeList with at least 2 employees of each type
Define a method displayEmployeeList (name, empid, bimonthsalary,vacation accrued) to a JTable
Define a method DisplayEmployeeList2. To display to a JTextArea the data returned by ToString() method.
arrow_forward
Create a method named getCircleDiameter that takes a radius of double type as the parameter. The method should return the diameter of a circle. To compute the diameter of a circle, multiply the radius by 2.Create a struct named Product where its fields are code, description, and price. Create a class named Person with an instance variable named full_name. Declare one (1) constructor without a parameter and initialize the variable with a default value.Create a class named Account with an instance variable named account_number. Make this class a member of the Accounts namespace.
arrow_forward
Modify the NumbersDemo application whose main() method holds two integer variables. Assign values to the variables.
In turn, pass each value to methods named displayTwiceTheNumber(), displayNumberPlusFive(), and displayNumberSquared().
Create each method to perform the task its name implies.
public class NumbersDemo {
public static void main (String args[]) {
// Write your code here
}
public static void displayTwiceTheNumber(int n) {
// Write your code here
}
public static void displayNumberPlusFive(int n) {
// Write your code here
}
public static void displayNumberSquared(int n) {
// Write your code here
}
}
arrow_forward
Using Java Eclipse do the following program:
Design a class named Rectangle to represent a rectangle. The class contains:
Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.
A no-arg constructor that creates a default rectangle.
A constructor that creates a rectangle with the specified width and height.
A method named getArea() that returns the area of this rectangle.
A method named getPerimeter() that returns the perimeter.
Draw the UML diagram for the class then implement the class. Write a test program that create two Rectangle objects - one with width 4 and height 40, and the other with width 3.5 and height 35.9.
Display the width, heigth, area, and perimeter of each rectangle in this order.
arrow_forward
Which java keyword is used to refer a class’s hidden data fields?
super
static
void
this
arrow_forward
FOR JAVA, PLEASE URGENT
Part I
Use Company class and create OptionDialog for 5 any methods about company.
Part II
Modify the methods to get input from user by dialog systems (InputDialog, OptionDialog etc.). You can add more if you don’t have proper methods to utilize dialogues.
Part III
Modify the exception handling codes to show the caught error by MessageDialog.
Part IV
Create an UI by JFrame in order to initialize the Company objects.
arrow_forward
Create a program named FindSquareRoot that finds the square root of a user’s input value. The Math class contains a static method named Sqrt() that accepts a double and returns the parameter’s square root. If the user’s entry cannot be converted to a double, display an appropriate message, and set the square root value to 0. Otherwise, test the input number’s value. If it is negative, throw a new ApplicationException to which you pass the message “Number can’t be negative.” and again set sqrt to 0. If the input value is a double and not negative, pass it to the Math.Sqrt() method, and display the returned value
arrow_forward
Modify the NumbersDemo application whose main() method holds two integer variables. Assign values to the variables.
In turn, pass each value to methods named displayTwiceTheNumber(), displayNumberPlusFive(), and displayNumberSquared().
public class NumbersDemo {
public static void main (String args[]) {
// Write your code here
}
public static void displayTwiceTheNumber(int n) {
// Write your code here
}
public static void displayNumberPlusFive(int n) {
// Write your code here
}
public static void displayNumberSquared(int n) {
// Write your code here
}
}
arrow_forward
create an application named TestMethods whose main() methods holds two interger varieble. Assign values to the variables. in turn pass each values to methods named displayIt() displayItTime() and displayItPlus One Hundred() java
arrow_forward
Some Websites impose certain rules for passwords, involving use of certain numbers and special characters.
Write a Python program (Console and GUI) that prompts the user to enter a password and displays "valid password" if the rule is follows rules of the company, or "invalid password" otherwise.
Write a method or a function for implementing the password checking rules for the method/function as follows:
A password must have at least eight characters.
A password must consist of only letters and digits.
A password must contain at least two digits.
Sample 1
Enter a string for password: wewew43x
valid password
Sample 2
Enter a string for password: 343a
invalid password
arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT