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

  Program to read information from keyboard

Write a C++ program that reads the following information from the keyboard terminated with the sentinel -999 in the Student Number, and stores the records in arrays (3 separate arrays).

  Find the maximum and minimum of a list of numbers

Write a prolog program to find the maximum and minimum of a list of numbers.

  Explain a functioning design in unity game engine

Need a functioning design in Unity Game Engine. The rough draft only needs the game level scene, skybox, the terrain (shaped, textured, with trees and grass), the buildings (with functioning doors), the avatar, and being able to "pick up" the two ..

  Program which accepts candy name-price per pound

A program which accepts the candy name (for example, "chocolate-covered cherries"), price per pound, and number of pounds sol in average month, and displays item's data only if it is best-selling item.

  Write complete main method using good programming practices

Write a complete main method using good programming practices when you rewrite the while loop as a do/while loop.

  User defined function to calculate average of three scores

A user defined function that will calculate and display the average of the 3 scores that remain after dropping the highest and lowest scores the performer received.

  Determine bowler had highest average and print name

Output the bowlers name, avg. and number of stars earned. Discover which bowler had the highest average and print out their name and average.

  Design program that asks user to enter budgeted amount

"Design a program that asks the user to enter the amount that he or she has budgeted for a month. (For example: $2,000.00)

  Program to inputs encrypted four-digit integer

Write separate program to inputs encrypted four-digit integer and decrypts it to form the original number. thanks in advance for ur help.

  Program to convert temperature in celcius from fahrenheit

Write the program which accepts the temperature in Fahrenheit from user and conversts it to Celsius by subtracting 32 from Fahrenheit value and multiplying result by 5/9. Show both values.

  Prepare function for one integer parameter-returns integer

Prepare the C++ function which needs one integer parameter and returns the integer value. Function will double value passed to it and return doubled value.

  Write program to read data of four students from input file

Write C++ program which reads data of 4 students from the input file which name is given by user and displays summary report of students' marks on output file stdMarks.out"

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