define a structure named 'planet' containing three fields 'name', 'distance', and 'size'. decide on the appropriate type of these variables
Answer: struct planet { char name[20]; double distance ; double size;};
here i have taken the length of character array as my convenience you can modify it.
define a structure named 'planet' containing three fields 'name', 'distance', and 'size'. decide on the appropriate...
1. Define a structure named StockItem with two string fields, supplier and productName and one int field, catalogNumber. Then define a structure named Customer with string fields name, streetAddress, city, postalCode, phone. Assume that structures named Date and Money have already been defined (representing a date and a monetary amount respectively. Finally, define a structure named Purchase that has these fields: buyer of type Customer, itemSold of type StockItem, dateOfSale of type Date, paid of type Money, returnable of type...
Define a user-defined VARRAY data type named Phone_List_type as an array of size three of the type phone_type. using SQL ORACLE
10 5. Create a structure named MyStruct containing two fields: field1, a single word, and field2, an array of 20 doublewords. The initial values of the fields may be left undefined. 6. Declare a variable as an array of 20 MyStruct objects. 7. Write a macro named mGenRandom that generates a random integer between 0 and n-1. Let n be the only parameter. 8. What is the purpose of the IFB directive?
Create a class named Poem that contains the following fields: title - the name of the poem (of type String) lines - the number of lines in the poem (of type int) Include a constructor that requires values for both fields. Also include get methods to retrieve field values. Create three subclasses: Couplet, Limerick, and Haiku. The constructor for each subclass requires only a title; the lines field is set using a constant value. A couplet has two lines, a...
define a new type called "mylist" that points to a structure named "listnode" that consists of two parts, an array of 5 integers named "data" and a pointer named "next" that points to the next "listnode" structure.
Hello! This is C++. Q3. Write a program Define a Super class named Point containing: An instance variable named x of type int. An instance variable named y of type int. Declare a method named toString() Returns a string representation of the point. Constructor that accepts values of all data members as arguments. Define a Sub class named Circle. A Circle object stores a radius (double) and inherit the (x, y) coordinates of its center from its super class Point....
Code the following Program in C++ Define a class named Payment that contains a member variable of type float that stores the amount of the payment and appropriate accessor and mutator methods. Also create a member function named paymentDetails that outputs an English sentence that describes the amount of the payment. Next define a class named CashPayment that is derived from Payment. This class should redefine the paymentDetails function to indicate that the payment is in cash. Include appropriate constructor(s)....
UPDATE THE UNIVERSE PROGRAM: C. Research the size of each CelestialObject and its distance from the sun (for planets) and the distance of the moons from the planets D. Calculate the distance between any two CelestialObject (e.g. between 2 planets and between two moons) COMPLETE STEPS C AND D and THE MODIFICATION BELOW. SUBMIT THE UPDATES! 1. GALAXY CLASS //**MODIFICATION NEEDED** //Use the DBPM format to complete the class. //Review the SolarSystem class for the Star attribute as an example...
Create a class named Horse that contains the following data fields: name - of type String color - of type String birthYear - of type int Include get and set methods for these fields. Next, create a subclass named RaceHorse, which contains an additional field, races(of type int), that holds the number of races in which the horse has competed and additional methods to get and set the new field. DemoHorses.java public class DemoHorses { public static void main(String args[])...
Provide the structure and the IUPAC name of a molecule containing three carbon atoms and two carboxyl groups CHEM