Look at the following declaration: enum Flower { Rose, Daisy, Petunia } a. What is the name of the data type? b. In memory, what value will be stored for the enumerator Flower.Rose? For Flower.Daisy? For Flower.Petunia? c. Write a statement that declares a variable of this enumerated type. The variable should be named flora. Initialize the variable with the Flower.Petunia enumerator.
Q: Create a class named Person, which contains A function named print() Two data fields i.e. personName…
A: Given:- Create a class named Person, which contains A function named print() Two data fields i.e.…
Q: Write a console application that initializes at least five (5) variables or constants with different…
A: The program is written in C#. Check the program screenshot for the correct indentation. Please check…
Q: If the first parameter has the Integer data type and the second parameter has the Double data type,…
A: Parameters: When the event happens, the information is passed to the event procedure, and that…
Q: The statement objectA == objectB compares the memory addresses of objectA and objectB O True O False
A: == operator compares reference or memory location of objects in the heap, whether they point to the…
Q: Look at the following statement.enum Color { RED, ORANGE, GREEN, BLUE };A) What is the name of the…
A: a) Color b) Color.RED Color.ORANGE, Color.GREEN Color.BLUE
Q: Create a class named as car with data members as carcompany,cost of car,number of airbags. Create a…
A: Include all the required headers. Create a class for the answer program. Declare variables of…
Q: What is wrong with the following code example. Select all those options that Select one or more:…
A: In the above code incorrect thing find the below step
Q: what do you mean by returning structures ?
A: Structure is user-defined data type, like built-in data types structure can be return from function
Q: ** Must use a header file, implementation file and main program ** 1) Please create a credit card…
A: #include<iostream>using namespace std; class CreditCard{ private: float balance;…
Q: Assume you have the following two-dimensional data structure called flowers: daisy…
A: We need print each line of data on a separate line. We need to traverse row wise in order to print…
Q: Where do you initialize a static data field?
A: Given: Where do you initialize a static data field?
Q: create a Calculator application using the functions, data operator and primitive data types. You can…
A: The calculator application with the given specifications is as follows.
Q: Your task is to create two classes namely data and calculation. The calculation class is a friend of…
A: C++ language is an object-oriented programming language, It will also be supported by procedural,…
Q: 1. Write a console application that initializes at least five (5) variables or constants with…
A: Steps to create C# console application Open visual studio C# application. Then File -> New ->…
Q: C++ #include #include class DollarAmount { public: // initialize amount from an int64_t value…
A: Actually, C++ is a statically typed, compiled, general-purpose, case-sensitive programming…
Q: The __________ creates an object in memory and returns a reference to that object. a. = operator b.…
A: ANS: - Option(c) is correct. The new operator creates an object in memory and returns a reference to…
Q: Create a class named Person, which contains A function named print() Two data fields i.e.…
A: Note: Below is the required program in the C++ language. Program Approach: Including a necessary…
Q: What's wrong with the following constructor definition? public void Test(String s) {…
A: Answer: it cannot have a return type such as void
Q: (In C++) This program should be designed and written by a team of students. Here are some…
A: C++ implementation is given below
Q: Object can’t be used with pointers because they belong to user defined class, and compiler can’t…
A: This statement is False because object can always be used with pointers like with any other…
Q: Create a class called Pencil. Pencil has a type. Create another class called Customer. The customer…
A: Input the number of purchases and based on that allocate memory inside constructor and print all the…
Q: What happens when a program uses the new operator to allocate a block of memory, but the amount of…
A: GIVEN: What happens when a program uses the new operator to allocate a block of memory, but the…
Q: ** Must use a header file, implementation file and main program ** 1) Please create a credit card…
A: GIVEN THAT:-- #include<iostream>using namespace std; class CreditCard{private:float…
Q: When you create a(n) __________, you specify a set of symbolic values that belong to that data type.…
A: The answer is given below,
Q: 2. Call-by-reference parameters pass values: a. By making the variable global. b. By passing the…
A: Call by reference parameter pass values.
Q: what is int data type ?
A: int data type means a variable which store integers values only. The other data type are float…
Q: This is the default value for fields declared to "hold" object instances.
A: Here the question is related to the default value for fields declared to hold object instances.
Q: ed Class in C++ In this lab, you create a derived class from a base class, and then use the derived…
A: Actually, c++ is a powerful general language. It is a high level language.
Q: What's the difference between a data member and a local variable?
A: ANSWER : Differences between Local variable and Data member or Instance variable : 1. A data member…
Q: Instructions: In the code editor, you are provided with a treasureChestMagic() function which has…
A: In this question we have to write a program in which using C language where We need to write a main…
Q: Create a struct called Complex for performing arithmetic with complex numbers. Write a driver…
A: void::Complex print. There should be a condition inside cout itself. No if-else. But I have no idea…
Q: Defines an enum named Classification. The enum Classification will have 2 data values:…
A: I have answered this question in step 2.
Q: When would you use the following return data types: Double, Integer, Boolean
A: I have given an answer in step 2.
Q: rallel arrays and range matches for this application. 1. Declare variables with proper data types…
A: using System;using System.Collections.Generic;class HelloWorld{ static void Main () {…
Q: Write a program that contains variables to hold employee data like; employee Code, employee Name and…
A: Since the programming language is not mentioned, I did the code using Python 3.
Q: Write a program that: Defines an enum named Classification. The enum Classification will have 2 data…
A: Please upvote me Please. I need it badly. Please. Please. I am providing the required code in…
Q: Create class Employee that has the following pieces of information called first name, last name, day…
A: Below is solution with detail explanation using c++ comments.
Q: You can create multiple instances of any class in C++. TRUE FALSE
A: C++ is an Object oriented programming language. In an Object oriented programming, everything is…
Q: Results of a survey of the households in your town have been made available. Each record contains…
A: Purpose of the program: This program creates an array of structure of household type including…
Q: his code is correct but can you do call this createKidPerson() in the main Code: #include…
A: #include <iostream>using namespace std; typedef struct { int age; char gender;} Person;…
Q: A constructor can specify the return type Select one: a. A constructor cannot specify a return type…
A: A constructor never returns any type. It is similar to class name. consider the following class:-…
Q: The set accessors should verify that length and width and depth are all floating-point numbers…
A: This is the solution for your question: First code public class Cube{ public double Length { get;…
Q: 2- How to access data members of a class? a) Dot operator b) Arrow operator c) Dot or arrow as…
A: The data members and member functions of class can be accessed using the dot('. ') operator with the…
Q: 11. Write the keyword for the appropriate data type that can be used with the variable myName that…
A: Write the keyword for the appropriate data type in JAVA that can be used with the variable myName…
Q: - Create a struct called Complex for performing arithmetic with complex numbers. Write a driver…
A: Given:- Program Approach:- 1.Create a class whose name is Complex for performing arithmetic…
Q: In Oop, Write a program that contains variables to hold employee data like; employeeCode,…
A: class Employee: def __init__(self,empCode,empName,dateofJoining): self.__empCode =…
Q: , Write a program that has variables to store Car data like; CarModel, CarName, CarPrice and…
A: Java program without creating the object: import java.util.Scanner; //create Car classpublic class…
Q: I need help creating a C++ Code. I need help Designing a PayRoll class that has data members for an…
A: According to the question below the solution: Output:
Look at the following declaration:
enum Flower { Rose, Daisy, Petunia }
a. What is the name of the data type?
b. In memory, what value will be stored for the enumerator Flower.Rose? For Flower.Daisy? For Flower.Petunia?
c. Write a statement that declares a variable of this enumerated type. The variable should be named flora. Initialize the variable with the Flower.Petunia enumerator.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Look at the following statement.enum Color { RED, ORANGE, GREEN, BLUE };A) What is the name of the data type declared by this statement?B) What are the enumerators for this type?C) Write a statement that defines a variable of this type and initializes it with a validvalue.Look at the following declaration:enum Flower { Rose, Daisy, Petunia } What is the name of the data type?Look at the following declaration:enum Flower { Rose, Daisy, Petunia } In memory, what value will be stored for the enumerator Flower.Rose? ForFlower.Daisy? For Flower.Petunia?
- Write a program that: Defines an enum named Classification. The enum Classification will have 2 data values: undergraduate, graduate. Defines an enum named Status. The enum Stutus will have 2 data values: parttime, fulltime. Defines an enum named Residency. The enum Residency will have 2 data values: resident, international. Defines a student name variable. Creates a Classification, Status, and Residency, credit hour, cost per credit hour, and tuition variable. Reads the value of the Classification, Status, and Residency, student name and credit hour variable from the user. If the student is a fulltime undergraduate resident student, tuition is credit hour times 345.00 If the student is a fulltime undergraduate international student, tuition is credit hour times 685.00 If the student is a fulltime graduate resident student, tuition is credit hour times 545.00 If the student is a fulltime graduate international student , tuition is credit hour times 885.00 If the student is a parttime…Write a program that: Defines an enum named Classification. The enum Classification will have 2 data values: undergraduate, graduate. Defines an enum named Status. The enum Stutus will have 2 data values: parttime, fulltime. Defines an enum named Residency. The enum Residency will have 2 data values: resident, international. Defines a student name variable. Creates a Classification, Status, and Residency, credit hour, cost per credit hour, and tuition variable. Reads the value of the Classification, Status, and Residency, student name and credit hour variable from the user. If the student is a fulltime undergraduate resident student, tuition is credit hour times 345.00 If the student is a fulltime undergraduate international student, tuition is credit hour times 685.00 If the student is a fulltime graduate resident student, tuition is credit hour times 545.00 If the student is a fulltime graduate international student , tuition is credit hour times 885.00 If the student is a parttime…You can use a________to convert a value explicitly between numeric data types, even if the translation results in data loss.
- Use the code provided to you to do the following: 1) Write code that implements the function withdrawal. 2) Deposit 1000 into checking account. 3) Deposit 500 into saving account. 4) Withdraw 100 from checking account. 5) Get balance for both checking and saving account and display the amounts. #include <iostream> usingnamespace std; class BankAccount{ private: float balance; public: BankAccount(); void Deposit(float); void WithDrawal(float); float getbalance(); };Build a small program that will generate a 52 card deck that will be used for a Black Jack game. The program should also shuffle the deck. In this exercise you will not build the game but rather just the part where a deck is generated then shuffled. Make sure that you have functions that generate the deck, shuffle the deck and then display the deck. You will use pointers to implement the passing of the deck between functions. Do not use structuresYou are developing a Fraction structure for Teacher’s Pet Software. The structure contains three public data fields for whole number, numerator, and denominator. Using the same structure, write the functions described below: • An enterFractionValue()function that declares a local Fraction object and prompts the user to enter values for the Fraction. Do not allow the user to enter a value of 0 for the denominator of any Fraction; continue to prompt the user for a denominator value until a valid one is entered. The function returns a data-filled Fraction object to the calling function. • A reduceFraction()function that accepts a Fraction object and reduces it to proper form, returning the reduced Fraction. For example, a Fraction entering the function as 0 2/6 would be reduced to 0 1/3, and a Fraction entered as 4 18/4 would be reduced to 8 1/2. • A displayFraction()function that displays any Fraction object passed to it. This function displays a fraction with a slash between the…
- Must be in C++ and cannot come from any online source. Please include all requested parts in problem. Create a class named Employee that has the following member variables: name - a string that holds the employee's name empIdNumber - an int variable that holds the employee's ID Number job - a string that holds the name of the position the employee is working in (Laborer, Manager, Secretary, etc.) yearsOfService- an integer that holds the employee's years of service The class should have the following constructors: A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name, employee ID number, job and years of service that are passed to them when the object is created (pass each of the four values into the constructor) A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name and ID Number. The job field should be assigned an…This need to be written in c++ Write a program that: Defines an enum named Classification. The enum Classification will have 2 data values: undergraduate, graduate. Defines an enum named Status. The enum Stutus will have 2 data values: parttime, fulltime. Defines an enum named Residency. The enum Residency will have 2 data values: resident, international. Defines a student name variable. Creates a Classification, Status, and Residency, credit hour, cost per credit hour, and tuition variable. Reads the value of the Classification, Status, and Residency, student name and credit hour variable from the user. If the student is a fulltime undergraduate resident student, tuition is credit hour times 345.00 If the student is a fulltime undergraduate international student, tuition is credit hour times 685.00 If the student is a fulltime graduate resident student, tuition is credit hour times 545.00 If the student is a fulltime graduate international student , tuition is credit hour times…This code is correct but can you do call this createKidPerson() in the main Code: #include <iostream>using namespace std; typedef struct { int age; char gender;} Person; void displayPerson(Person); Person createKidPerson(Person father, Person mother); int main(void) { Person father; Person mother; father.gender = 'M'; mother.gender = 'F'; cout<<"Enter the Male Person's age: "; cin>>father.age; cout<<"Enter the Female Person's age: "; cin>>mother.age; Person kid = createKidPerson(father, mother); displayPerson(kid); return 0;} Person createKidPerson(Person father, Person mother){ Person p; if((father.age==mother.age) && (father.age%2==1)){ p.gender='F'; } else if(father.age>=mother.age) p.gender='M'; else p.gender='F'; p.age=1; return p;}void displayPerson(Person p){ cout << "\nPERSON DETAILS:" << endl;…