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

  Employee wage data application

A small company is moving all its employee data to a computer. To make a smooth transition, a software program will permit the data entry personnel to enter data into a file. Design a program that writes the employees.dat file

  Prolog program to reads employee-s number

Write a prolog program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

  Design program to ask user to enter amount of purchase

Design a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax.

  Write application to compute and show parking charges

Write down the application which computes and shows parking charges for each customer who parked in garage yesterday. You must enter hours parked for each customer.

  Implement a stack adt by writing a class called stack

Implement a stack ADT by writing a class called Stack. Use a static array to hold stack elements.  Instantiate the Stack class in the main function and provide a user loop and a menu so that all the Stack class member-functions, push, pop, etc.,

  Write function template which accepts array

Write a function template arraySum () which accepts array and number of values stored in it and returns the sum of those values.

  Create program for hollywood movie rating guide

Create a program for the Hollywood Movie Rating Guide,in which users continuously enter a value from 0 to 4 that indicates the number of stars they are awarding to the Guide's featured movie of the week.

  Two-level memory cache hierarchy

Explain how you would pipeline the four following pairs of statements.

  Using a software program to create story books

submit a unit plan spanning Two to Four weeks. See this example of a unit plan, (or search the web for a unit plan example that best suits matches your needs). Technology should be integrated for assessment, instruction, and student engagement..

  Calculate the amount of profit and loss

Calculate the amount of profit and loss. Also if Profit then display the smiley face, if loss then display sad face and if break even then confused face.

  Develop logic to accept number of passengers-zones as input

Develop the logic for a program that accepts the number of passengers and zones crossed as input. the output is the ticket charge.

  Find the date format is valid or not

Display the date and message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid.

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