Create a utility procedure

Assignment Help Programming Languages
Reference no: EM13806254

Program #1.

Sum of Digits in a String. It is necessary to create a utility procedure that allows you to convert from a character to an integer value to allow you to sum the values of the digits in a string. Also, Raptor will not allow you to input a numeric value and treat it as a String input. To work around this limitation, I would recommend putting a character like 'a' somewhere in your input value so Raptor will treat the input as a String data type. Your program should be designed in such a way that it will ignore any non-numeric characters in the input string.

Program #2

Area of Shapes: Design a superclass called Shape that contains one function-getArea(). The getArea() function in the Shape class will simply return 0, you will derive from it in your subclasses mentioned below. Define 3 subclasses of the Shape class-circle, rectangle, and triangle. The circle class will need a radius field, the rectangle class will need length and width fields, and the triangle class will need base and height fields. Declare all of the appropriate setters and getters for each of these classes. The circle class will calculate it's area as PI*r*r. The rectangle's area is length * width. The triangle's area is .5 * base * height.

Demonstrate your classes be writing a menu driven program that allows the user to select which shape they want to create. After making their selection, the program will ask the user to input the appropriate dimensions for that shape. The program should then display the area for that shape. The menu will continue to display until the user chooses to quit.

Reference no: EM13806254

Questions Cloud

Governmental activity from the second list : Select one of the laws listed below and explain how it has changed the staffing process.  Also select one governmental activity from the second list and explain how it influences staffing. Respond substantively to two other learners.
What is the color of transmitted light : What is the wavelength - what is the phase constant of the wave and What is the color of reflected light? What is the color of transmitted light?
Governmental activity from the second list : Select one of the laws listed below and explain how it has changed the staffing process.  Also select one governmental activity from the second list and explain how it influences staffing. Respond substantively to two other learners.
Journal-ethical communication : journal-ethical communication
Create a utility procedure : Sum of Digits in a String. It is necessary to create a utility procedure that allows you to convert from a character to an integer value to allow you to sum the values of the digits in a string
Understanding of leadership : Write a 3 page review from the textbook The Leadership Experience (2010). Be honest as to their contribution to your understanding of leadership.
Write essay about apartments from my interview with people : Write an essay about apartments from my interview with people notes.
Pearson correlation and regression analysis issues : Based on your correlation coefficient, how good (valid) is your prediction, poor, okay, good, very good?
Create an inheritance relationship between two classes : For this assignment you will create a simple class hierarchy. You will create an inheritance relationship between two classes -- a Friend class and a Person class - Friend will inherit Person

Reviews

Write a Review

 

Programming Languages Questions & Answers

  Find the position s of a body in linear motion

How many miles will the car go during the period of acceleration from zero to 60 mph? Use the given program to answer this question - Prepare code to declare variables for s0, v0, a, and t, and then write the code to compute s on the basis of these ..

  Write console application that displays the sizes

Create a file that contains your favorite movie quote.  Use a text editor such as Notepad and save the file as Quote.txt.  Copy the file contents and paste them into a word-processing program such as Word.

  Complete the function function has three parameters

Complete the function: func in the following program. This function has three parameters: The first and second parameters are of type: int. The third one is a function that has two parameters of type: int and returns a value of type: int.

  Specific changes made for different countries-sites directed

Why were these specific changes made for different countries at whom the sites were directed? Is there anything else you would consider changing.

  Probability line is executed in nth iteration of for loop

What is the probability that line is executed during the nth iteration of the for loop? What is the exact expected number of executions of line?

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Create function m-file called mass that requires two vector

Create a function M-file called mass that requires two vector inputs-the number of moles and the molecular weight-and returns the corresponding mass. Because you are providing vector input, it will be necessary to use the meshgrid functio..

  Write a program using binary search approach

Write a program using binary search approach

  Design psuedocode program to calculate amount

Design a psuedocode program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day.

  Write client-side javascript function to convert ampersands

Your job is to write a client-side JavaScript function that converts all ampersands in a form field to the text string " and " when the form loses focus on the textbox in question.

  Write program which asks user for number of bolts

Write C++ program which asks user for number of bolts and number of nuts in their purchase and then computes and prints out total cost.

  Write a method named maxelement

Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demonstrate the method in a program.

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