Explain C# code line by line
Q: C
A: Approach: The approach of the given program: Declare the variable Using random seeds to create…
Q: ) C language has been developed by
A: C Programming Language: The general-purpose programming language C was created in 1972 and is…
Q: What role does typedef play in the C programming language? Explain.
A: Introduction: typedef is a keyword in the C programming language that is used to give existing…
Q: computer Describe some of the notions that Ada Lovelace came up with.
A: Introduction: Ada Lovelace is widely regarded as the world's first computer programmer. Even though…
Q: in c programming
A: GIVEN: Create a C program with a function to find the value in an integer array a[] of length N that…
Q: Basic data type in c++
A: Given: Basic data type in c++
Q: nguage please answe
A:
Q: Write a C program
A: Program Approach: Including the necessary header file. Defining the main method. Defining two…
Q: OOP project by java programming language
A: import java.util.*;import java.lang.*;import java.io.*; class main{ @SuppressWarnings("unchecked")…
Q: Explain Java bytecodes.
A: Java bytecode: Java bytecode is referred to as a set of instructions for Java Virtual machine…
Q: what are the advantages of using WORD application.
A: Advantages of using WORD application
Q: C++ basic definitions
A: C++ is an object-oriented computer language created by notable computer scientist Bjorne Stroustrup…
Q: OBJECT ORIENTED PROGRAMMING JAVA
A: Here have to determine about Java code for find odd even from array.
Q: write C++ program
A: Task: to create a c++ program
Q: C progra
A: Given :
Q: What are stdin, stdout, and stderr in Computer Programming?
A: Standard Input Stream It is an input stream where data is sent. Then is read by the program. It…
Q: In C Language and not C++ PLEASE C Language not C++
A: #include <stdio.h>#include <stdlib.h> void charges(float hour , float* money, float*…
Q: write a c program
A: As per the requirement program is completed. Algorithm: Step 1: Declare base and exponent values to…
Q: C language
A: We need to read in the values of n1,n2,n3 and n4 and print the pattern as per the given description.
Q: Simple C program for Library System
A: According to the asked question, the solution is given below with a proper explanation.
Q: 11. This is an example of a very-high-level programming language. a. Java b. Prolog C. C d. Assembly
A: The question has been answered in step2
Q: in C language please and thank you!!!
A:
Q: in C program.
A: C programming
Q: C programming: Write a C program to print the version of C language used by the compiler.
A: To print, the version of C language compare the STDC version and use the conditions mentioned below:…
Q: In C programming language
A: Errors in the code has been identified, let us see the details below,
Q: Enumerate the reserved words in C++ programming language and give a short description in each…
A: There are a total of 95 reserved words in C++.
Q: You can use C# or C++ language for implementation
A: C++ implementation : virtual member method allows the implementation of methods which is according…
Q: What exactly is C programming?
A: Required: What exactly is C programming?
Q: write a c++ program
A: According to the question We have to write C++ Code for Given a time in 24-hour notation, write a…
Q: Write a c program
A: C language
Q: Explain briefly what the C++ language is and its history.
A: What is c++: C++ offers the feature of portability which allows the user to run the same program on…
Q: Car Class in C++ language whole task is in the picture
A: Here in the code Class car is created where a class is a user-defined data type that we can use in…
Q: Define C language.
A: C is a procedural or modular programming language created by Dennis Ritchie and Ken Thompson in…
Q: Write a C++ program.
A: Coded using C++.
Q: age
A: r12=(x2-x1)2+(y2-y1)2+(z2-z1)2=(3-1)2+(-4-2)2+(-5-3)2=4+36+64=104=10.19r23=(x2-x1)2+(y2-y1)2+(z2-z1)…
Q: ode not Java
A: Since in give code segment, there is used a special type of variable called static which works on…
Q: language
A:
Q: Subject is C++ programming
A: Lets see the solution.
Q: 9. Java. V code.
A: We have to write JAVA code:
Q: n C# programming language.
A:
Q: Define C++ program.
A: C++: C++is an object oriented computer programming All C++ program contains at least one function…
Q: Control statement in c++
A: Control statements are how programmers indicate which section of code to use at specific times. Lets…
Q: Advantage and disadvantage of java programming environment
A: Given: Advantages and disadvantages of the java programming environment
Q: ompiler Design
A: Q
Q: write a program with C language
A: program approach print the graph get the maximum value of distribution· assume a…
Q: Write a c++ program
A: In this solution we write a C++ code to find percentage of attendance for a student and decode…
Q: c programming.
A: task: take two numbers from the user. check which one is bigger and print the biggest number using a…
Step by step
Solved in 2 steps
- Following is the class of Person: public class Person { private String Name; public int age; public void set(String Name, int age) { this.Name = Name; if(age > 0 && age <= 100) this.age = age; else this.age = 1; } public void display() { System.out.println("Name: " + this.Name +" ,Age: " + this.age); } public static void main(String[] args) { PersonManagement personManagement = new PersonManagement(); Person p1 = new Person(), p2 = new Person(), p3 = new Person(), p4 = new Person(), p5 = new Person(); p1.set("Asad", 103); p2.set("Ali", 17); p3.set("Usman", 16); p4.set("Raees", 18); p5.set("Mujeeb", 15); Person[] persons = new Person[]{p1,p2,p3,p4,p5};…public class Plant { protected String plantName; protected String plantCost; public void setPlantName(String userPlantName) { plantName = userPlantName; } public String getPlantName() { return plantName; } public void setPlantCost(String userPlantCost) { plantCost = userPlantCost; } public String getPlantCost() { return plantCost; } public void printInfo() { System.out.println(" Plant name: " + plantName); System.out.println(" Cost: " + plantCost); }} public class Flower extends Plant { private boolean isAnnual; private String colorOfFlowers; public void setPlantType(boolean userIsAnnual) { isAnnual = userIsAnnual; } public boolean getPlantType(){ return isAnnual; } public void setColorOfFlowers(String userColorOfFlowers) { colorOfFlowers = userColorOfFlowers; } public String getColorOfFlowers(){ return colorOfFlowers; } @Override public void printInfo(){…(java) The Painting Subclass Write class as follows: The class is named Painting, and it inherits from the Art class. It has a private String member variable named medium It has a default constructor that assigns the values "No name" to name, "No artist" to artist, -1 to year, and "No medium" to the medium variable. This default constructor calls the four-argument constructor. It has a four-argument constructor to assign values to the name, artist, year, and medium variables. It has a getter and settersfor the medium variable. It has a toString() method This class contains no other methods Make sure to include your name, the name of this class, our course number, and the Activity number in a Javadoc comment at the top. Make sure to write a Javadoc comment for each of these methods.
- Programming Language= PYTHON 3. Personal Information Class Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information. My information: Name: John Doe Address: 111 My Street Age: 22 Phone Number: 555-555-1281 Mom's information: Name: Mom Address: 222 Any Street Age: 52 Phone Number: 555-555-1234 Sis's infomation: Name: Jane Doe Address: 333 Her Street Age: 20 Phone Number: 555-555-4444 Dad's information: Name: Dad Address: 222 Any Street Age: 56 Phone Number: 555-254-5611Design and implementation of Java (Draw UML) classes 1. Design a class named Bill to represent a square. 2. The class contains: • One data field called “Items” that defines the number of items. Another double data field called "price" defines the price. The default is 1.0. • no-arg constructor • constructor with parameters to create the invoice • method called getBill () that returns the item and price duplication. 3. Create a class and test a class (create three different objects and print the values of the variables and method)ShoppingCart.java - Class definition ShoppingCartManager.java - Contains main() method Build the ShoppingCart class with the following specifications. Private fields String customerName - Initialized in default constructor to "none" String currentDate - Initialized in default constructor to "January 1, 2016" ArrayList cartItems Default constructor Parameterized constructor which takes the customer name and date as parameters Public member methods getCustomerName() accessor getDate() accessor addItem() Adds an item to cartItems array. Has a parameter of type ItemToPurchase. Does not return anything. removeItem() Removes item from cartItems array. Has a string (an item's name) parameter. Does not return anything. If item name cannot be found, output a message: Item not found in cart. Nothing removed. modifyItem() Modifies an item's description, price, and/or quantity. Has a parameter of type ItemToPurchase. Does not return anything. If item can be found (by name) in cart,…
- The class diagram below shows an Order class that "has a" Customer and zero or more Items. Order class should contain private Customer m_cust; private ArrayList<Item> m_items; public Order(Customer cus t) public void additem(Item i) public String toString() Item class should contain private String m_desc private int m_qty private double m_price public Item(String des c, double price, int qty) public String toString() Customer class should contain private String m_first; private String m_last; public Customer(String first, String last) public String toString() Please create the Order, Customer, and Item classes shown above. I have provided you with a read-only Main class that you can use to test your code. When you have completed the Order, Customer, and Item classes, running the Main program should produce the following output: Order for Smith, Tom Order Items: Greeting Card: 1 at 1.5 Baseball Glove: 1 at 54.0 Notebook: 3 at 2.5 public class Main{ public static void…Person and Customer Classes Write a class named (Person) with data attributes for a person’s name, address, and telephone number. Provide accessors/getters and mutators/setters for each attribute. Write a displayPerson() to print out the attributes of the Person. Next, write a class named (Customer) that is a subclass of the (Person) class. The (Customer) class should have a data attribute for a customer number, and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Provide accessors/getters and mutators/setters for each attribute. Write a display customer() to print out the attributes of the Customer. Demonstrate an instance of the (Customer) class in a simple program.The class "Student" has the following attributes: studentId (int), name (String), surname (String), deptCode (String).Write a constructor method for the "Student" class that takes values as parameters for all these attributes.
- Create an abstract CardGame which contains a “deck” of 52 playing cards that uses a Card class that holds a suit and value for each Card object. It also contains an integer field that holds the number of cards dealt to a player in a particular game. The class contains a constructor that initializes the deck of cards with appropriate values (e.g., “King of Hearts”), and a shuffle() method that randomly arranges the positions of the Cards in the array. The class also contains two abstract meb. Create two child classes that extend CardGame. You can choose any games you prefer. For example, you might create a Poker class or a Bridge class. Create a constructor for each child class that initializes the field that holds the number of cards dealt to the correct value. (For example, in standard poker, a player receives five cards, but in bridge, a player receives 13.) Create an appropriate displayDescription() and deal() method for each child class.Nutritional information (classes/constructors) PYTHON ONLY Complete the FoodItem class by adding a constructor to initialize a food item. The constructor should initialize the name (a string) to "None" and all other instance attributes to 0.0 by default. If the constructor is called with a food name, grams of fat, grams of carbohydrates, and grams of protein, the constructor should assign each instance attribute with the appropriate parameter value. The given program accepts as input a food item name, fat, carbs, and protein and the number of servings. The program creates a food item using the constructor parameters' default values and a food item using the input values. The program outputs the nutritional information and calories per serving for both food items. Ex: If the input is: M&M's10.034.02.01.0 where M&M's is the food name, 10.0 is the grams of fat, 34.0 is the grams of carbohydrates, 2.0 is the grams of protein, and 1.0 is the number of servings, the output is:…public class FoodItem { private String name; private double fat; private double carbs; private double protein; // TODO: Define default constructor // TODO: Define second constructor with parameters to initialize private fields (name, fat, carbs, protein) public String getName() { return name; } public double getFat() { return fat; } public double getCarbs() { return carbs; } public double getProtein() { return protein; } public double getCalories(double numServings) { // Calorie formula double calories = ((fat * 9) + (carbs * 4) + (protein * 4)) * numServings; return calories; } public void printInfo() { System.out.println("Nutritional information per serving of " + name + ":"); System.out.printf(" Fat: %.2f g\n", fat); System.out.printf(" Carbohydrates: %.2f g\n", carbs); System.out.printf(" Protein: %.2f g\n", protein); }} import java.util.Scanner; public class NutritionalInfo {…