Indicate whether each of the following enumerated data type definitions is valid or invalid. If it is invalid, tell what is wrong with it.
A) enum Holiday { Easter, Halloween , Thanksgiving, Christmas};
B) Enum Holiday { Easter, Halloween, Thanksgiving, Christmas};
C) enum Holiday { "EASTER", "HALLOWEEN"",T HAKNSGIVING", "CHRISTMAS"} ;
D) enum Holiday { EASTER, HALLOWEEN, THANKSGIVINGC, HRISTMAS}
nextHoliday;
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Software Engineering (10th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Starting Out with Java: Early Objects (6th Edition)
- Question Object Oriented Programming c++ Write a program that defines a class with a data member to holds a "serial number" for each object created from the class. That is, the first object created will be numbered 1, the second 2, and so on. To do this, you'll need another data member that records a count of how many objects have been created so far. (This member should apply to the class as a whole; not to individual objects. What keyword specifies this?) Then, as each object is created, its constructor can examine this count member variable to determine the appropriate serial number for the new object. Add a member function that permits an object to report its own serial number. Then write a main() program that creates three objects and queries each about its serial number. They should respond I am object number 2, and so on.arrow_forward16. A(n) ____ is a user-defined data type that can include both data and functions.A. ad-hoc data type B. programmer type C. abstract data typearrow_forwardPROGRAMMING LANGUAGE: C++ The following codes are required to run the program [3 CODES IN TOTAL]: dateType.cpp, dateType.h, main.cpparrow_forward
- PROGRAMMING LANGUAGE: C++ Write a program which has a class named FileHandlerto read StudentName, MarksObtained from the attached picture. The class should have a function which calculates grade for a student and then adds it in a new column i.e. Grade. The grade should be calculated considering the following criteria. A: 87-100, B+: 80-86, B: 72-79, C+: 66-71, C: 60-65, D: 50-59, F: 0-49 The file should be saved once grade for all students is calculated. Write the driver program for executing the task.arrow_forwardMark the following statements as true or false. All members of a struct must be of different types. (1) A struct is a definition, not a declaration. (1) A struct variable must be declared after the struct definition. (1) A struct member is accessed by using the operator :. (2) The only allowable operations on a struct are assignment and member selection. (2) Because a struct has a finite number of components, relational operations are allowed on a struct. (2) Some aggregate input/output operations are allowed on a struct variable. (2) A struct variable can be passed as a parameter either by value or by reference. (4) A function cannot return a value of the type struct. (4) An array can be a member of a struct. (6, 7) A member of a struct can be another struct. (8)arrow_forward// NOTE: Two separate versions of the sequence (one for a sequence of real numbers and another for a sequence of characters are specified, in two separate namespaces in this header file. For both versions, the same documentation applies.// TYPEDEFS and MEMBER functions for the sequence class:// typedef ____ value_type// sequence::value_type is the data type of the items in the sequence.// It may be any of the C++ built-in types (int, char, etc.), or a// class with a default constructor, an assignment operator, and a// copy constructor.// typedef ____ size_type// sequence::size_type is the data type of any variable that keeps// track of how many items are in a sequence.// static const size_type CAPACITY = _____// sequence::CAPACITY is the maximum number of items that a// sequence can hold.//// CONSTRUCTOR for the sequence class:// sequence()// Pre: (none)// Post: The sequence has been initialized as an empty sequence.//// MODIFICATION…arrow_forward
- The code is in C++arrow_forwardObject oriented programming Intellijarrow_forwardstruct namerec{ char last[15]; char first[15]; char middle[15]; }; struct payrecord{ int id; struct namerec name; float hours, rate; float regular, overtime; float gross, tax_withheld, net; }; Using C language. Given the above declaration, let payroll data record be stored in a structure called payrecord. Also define a type called payrecord for the structure data type that houses a payroll data record: typedef struct payrecord payrecord; This program reads data, computes payroll and prints it. Each data record is a structure, and the payroll is an array of structures. Overtime hours are 150% of the rate. (Note: Maximum regular hours for the week is 40.) Tax is withheld 15% if weekly pay is below 500, 28% if pay is below 1000, and 33% otherwise. A summary report prints the total gross pay and tax withheld. The following are the function prototypes: void readName(payrecord payroll[], int i); - reads a single name. void printName(payrecord payroll[], int i); - prints a single name. void…arrow_forward
- Programming Language: C++ Create an Abstract Data Type, which will store 2 integer number. After that, make operations which will set the value of the two numbers, add, subtract, multiply and divide. After creating the abstract data type, use it in the main class. Ask the user for the value of two integers. Ask the user what operation to use, then call the necessary operation based on the user's input. Then display the answer with the correct label. Do not copy paste codes from other sitesarrow_forwardProgramming language : c++ Question : Make a class Student with attributes StudentName, Enrollment, semester, section, course MarksObtained and Grade. Write appropriate constructors, get and set functions for data members. The data member grade is automatically calculated based on marks obtained out of 100 for each course.arrow_forwardC++ programmingarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT