Студопедия

КАТЕГОРИИ:

АстрономияБиологияГеографияДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРиторикаСоциологияСпортСтроительствоТехнологияФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника


Base level




Creation of a class

Implement class with two fields (Field 1, Field 2) and four methods:

- two constructors for initialization of object (with parameters and without parameters);

- function of obtaining information string about object;

- function of calculation some given characteristic of object.

In main program create an object using values from Edit components or constant values and write the information about the object to Memo.

Table 1. Individual tasks.

№ of variant Field 1 Field 2 Function
Nominal of banknote: integer number Number of banknote Calculate total amount of money
Radius of a coin Thickness of a coin Calculate the volume of a coin
Price of product (floating point number) Quantity of product (integer) Calculate the total cost of a product
Calorific value of 100 g of food Food weight in gramm Calculate total calorific value of food
Real number – lower bound of a range Real number – upper bound of a range Check whether given number is inside of the range
Number of minutes Number of seconds Calculate total amount of seconds
Number of hours Number of minutes   Calculate total amount of minutes
Real number – first cathetus of a right triangle Real number – second cathetus of a right triangle Calculate area of the triangle
Real number – speed (m / sec)   Integer – movement time in minutes Calculate the distance traveled (in meters)
Real number – first cathetus of a right triangle Real number – second cathetus of a right triangle Calculate the hypotenuse of the triangle
Integer number Integer number Calculate half the sum of numbers
Real number – first cathetus of a right triangle Real number – second cathetus of a right triangle Вычислить тангенс угла, противолежащего второму катету прямоугольного треугольника
Integer number Integer number Calculate half the difference between the numbers
Real number Real number Calculate the product of numbers
Integer number Integer number Вычислить целую часть от деления поля1 на поле2 с проверкой на нуль знаменателя
Integer number Integer number Calculate the square of the smaller number
Integer number Integer number Calculate the cube of the greater number
Call duration in minutes The cost per call minute Calculate total cost of the talk
x-coordinate of point y-coordinate of point Calculate the distance from the point (-3; 3)
Real number (a) Real number (b) For given number х calculate the value y = a x2 + b
Real number (a) Real number (b) For given number c calculate the root of the equation a x + b = c
x-coordinate of point y-coordinate of point Calculate the distance from the point (1; 3)
x-coordinate of point y-coordinate of point Define if the point is inside the circle of radius 5 with the center in origin of coordinates
Radius of conus base Height of conus Calculate the volume of conus
Voltage (in volts) Resistance (in ohms) Calculate the value of current (in amps)
Value of current (in amps) Resistance (in ohms) Calculate the power
Mass (in kg) Velocity (in m/s) Calculate the kinetic energy of a body

 


Поделиться:

Дата добавления: 2015-08-05; просмотров: 129; Мы поможем в написании вашей работы!; Нарушение авторских прав





lektsii.com - Лекции.Ком - 2014-2024 год. (0.009 сек.) Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав
Главная страница Случайная страница Контакты