Create static methods with and without return values

Assignment Help DOT NET Programming
Reference no: EM13971176

Programming Assignment-

DESCRIPTION

Programming Assignment illustrates the use of user-defined static (class) methods that do and don't return values. The program calls four static methods that break up tasks into logical groupings. Each method performs a different action: One displays the title, another performs input, a third method performs a calculation and displays a result, and another terminates the program.

OBJECTIVE

This project is designed to introduce the use of user-defined static methods in the Visual C# console environment. Specific objectives are to develop skills with respect to:

· Using correct naming conventions

· Creating static methods with and without return values

· Calling static methods with and without arguments

· Casting data types

· Proper internal documentation

· Correct indentation and use of white space for readability

· Use of format specifiers and tokens

DIRECTIONS

1. Create a new project.

2. Project Type (Visual C#)

3. Template (Console Application)

4. Name (PA03LastNameFirstInitial)

5. Rename the Program.cs file to CalculateApp.cs

6. Include your name, course and section, the class file name, and a brief description of the program (in that order) in a multi-line comment at the very top of your code (above the first "using" statement.

7. Include internal documentation using inline comments as appropriate. Remember you can copy the pseudocode below and use it as your comments.

8. When completely finished and ready for grading, add your full solution folder to the J: drive and attach your class file then click the Submit button in BB Learn prior to the deadline

Example of Program Output - (your output should match closely)

PseudoCode

Main() Method

· Declare the following variables:

o numerator - integer

o denominator - integer

o answer - double

· Call a method to display the title

· Call a method to prompt the user for an integer and assign it to your numerator

· Call a method to prompt the user for an integer and assign it to your denominator

· Display a horizontal line

· Call a method to perform the division (pass 2 arguments to the method) and store the result into your answer variable

· Display the result on the screen (show 4 decimal places like in the screenshot example). Hint:

o Console.WriteLine("{0}/{1} = {2:N4}", numerator, denominator, answer);

o (The:N4after the token will display the answer with 4 decimal places.)

· Display a horizontal line

· Call a method to end the program

DisplayTitle() Method (your method identifier should match)

· (This method should take in no parameters and return no values)

· Change the foreground and background color

· Clear the console

· Display the title

· Display a horizontal line

InputInteger() Method (your method identifier should match)

· (This method should take in no parameters and return an integer)

· Declare a variable to hold the integer value input by the user

· Prompt the user to enter an integer

· Store the integer in the variable

· Return the integer

PerformDivision() Method (your method identifier should match).

· (This method should take in two parameters and return a double)

· (Do not use numerator and denominator as your parameter identifiers)

· Return the solution to the division of the two parameters

· If your answer is not showing decimal places, remember to cast the two operands as a double. Hint:

o return (double) number1 / (double) number2;

TerminateProgram() Method (your method identifier should match)

· (This method should take in no parameters and return no values)

· Display a prompt to have the user press any key to terminate the program

· Pause execution until the user presses any key

Reference no: EM13971176

Questions Cloud

What problems did lyft face : What problems did Lyft face when trying to expand in the Boston market? Why do you suppose Uber is winning in Boston and many other cities
Determine the best approaches for the transition : Brief all employees the plan of the employees moving the inventory from Hangar 12 to Hangar 18, inform them on the schedule for the transition, inform them on overtime and hour constraints, and finally inform them on their responsibilities.
Financial and business risks within business structure : With any type of business venture there is always risk involved and we have to look at capital structure decisions as we move through changing economic times. What is a business risk and what are some of the factors that influence a firm’s business r..
Stock and bonds : A search of the Internet for a stock and bond of your choice that has historical data performance measures that you can evaluate for the last twenty years. Once you have completed your evaluation please explain your findings and which option would ha..
Create static methods with and without return values : Create static methods with and without return values. Calling static methods with and without arguments. Casting data types. Proper internal documentation.
Compute the cost of goods sold : Prepare the journal entries to record the July transfer of completed goods and the July cost of goods sold.
Contribute to the successful management of an organization : Determine the key ways that an understanding of organizational behavior can contribute to the successful management of an organization. Explain your experience utilizing or witnessing the use of OB in your work environment.
What are the total market value of the firm stock : What are the total market value of the firm's stock and the firm's total market value? What is the firm's weighted average cost of capital?
Benefits a company can attain from implementing web services : Write a 1-2-page paper describing what benefits a company can attain from implementing web services

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Create a shopping cart in asp

The users will use a browser to access the on-line store. The web server software for the production web server is Windows 2003 Server /IIS6.

  What is entity-relationship diagram

What is Entity-relationship diagram for e-resource planner software.

  Write a program that allows auser to enter a car price

Write a program that allows auser to enter a car price. The output is the salesperson's commission. Save the programas Commission.cs.

  Concepts of home directory

In this lab you will learn the concepts of home directory, working directory, absolute pathname, and relative pathname. You will learn to use cd to make another directory the working directory, pwd to display the name of the working directory, rm ..

  Convert meters to feet and inches.

1. Write a program that can be used to convert meters to feet and inches. Allow the user to enter a metric meter value in a method .

  Design the interface and add code to the command buttons

Design the interface and add code to the command buttons to achieve the using case statement.

  Write a complete c# program in console mode to load the data

Write a complete C# program in console mode to load the data file as a sequential file using C# System.IO library into an ArrayList data structure (using the System.Collection library) Store each line in the file as a separate record.

  Create a new web form called frmuseractivity

Create a new Web form called frmUserActivity. Switch to Design Mode and add a Label and GridView (found under the Toolbox, Data tab) having the following properties:

  What is a connectionstring

What is a ConnectionString. Give a suitable example to illustrate the various part of a ConnectionString

  Web site for a business

Create the application and/or a web site for a business (choice is yours).You must use five (5) programming techniques discussed in this class.Should be database driven with at least 25 products.Compile and test the application before you submit i..

  Create web application to be used as a loan calculator

Create an ASP.NET web application to be used as a loan calculator. The textboxes used to input data (loan amount, repayment period in months, and interest rate) should be checked for valid entries

  What is the full path the to location of the web application

what is the full path the to location of the web application directory for the cset-test web application and what is the full path to the main.jsp file for the cset-test web application?

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