Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create a java program that initialize a two dimensional array with the continuous assessment marks used to determine the semester mark for PRG510S exam qualification, The system should also create an array of student names in correspondence to the marks (Note: the appropriate weights of each individual assessment are given under corresponding headings and both the marks and student names are read from the user input).

test1

 (Weight 20%)

test2

 (Weight 20%)

labs

 (Weight 20%)

in_class exercise

(Weight 10%)

assignment

 (Weight 30%)

John

50

60

79

89

63

Harry

41

52

68

56

40

Uushona

30

20

52

38

47

Sililo

23

Enter class size: 4

Enter student name:John

Enter John’s semester marks: 50 60 79 89 63

Enter student name:Harry

Enter Harry’s semester marks: 41 52 68 56 40

Enter student name:Uushona

Enter Uushona’s semester marks: 30 20 52 38 47

Enter student name:Sililo

Enter Sililo’s semester marks: 23 33 45 19 27

Write a java program that accepts given n number of marks for a PRG510S test, and stores them into an array named marks. After all marks have been entered your program should accomplish the following: 

[- to be provided by user input]

a)   Find and display the highest mark

b)   Find and display the lowest mark

c)    Compute and display the average mark

(Above tasks (a, b, and c should be accomplished using only one loop)

 

Sample Run1

            Enter numbers of marks: 10

           Enter 10 marks: 55 60 89 75 25 77 92 15 68 40

Output1: Highest Mark = 92%

Lowest Mark = 15%

Average = 58%

Write a java program that specifies three parallel one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements provided by user input. Using a for loop input values for length and width arrays. The entries in the area arrays should be the corresponding values in the length and width arrays (thus, area[i] = length [i]* width [i]) after data has been entered display the following output:


Length Width Area


-------- -------- -------


25 2.6 65.00


18.2 4.9 89.18


Sample Run1


Enter the array size: 5


Enter the Length and Width for Rectangle 1: 25 2.6


Enter the Length and Width for Rectangle 2: 18 4.9


Enter the Length and Width for Rectangle 3: 100 3.27


Enter the Length and Width for Rectangle 4: 1.84 7.4


Enter the Length and Width for Rectangle 5: 56 9.5


Q2: Answer the questions (i) to (iv) based on the following:
class Publisher
{
char pub[12];
double turnover;
protected:
void register();
public:
Publisher();
void enter();
void display();
};

class Branch
{
char city[20];
protected:
float employees;
public:
Branch();
void haveit();
void giveit();
};

class Author : private Branch, public Publisher
{
int acode;
char aname[20];
float amount;
public:
Author();
void start();
void show();
};
i. Write the names of data members, which are accessible from objects belonging to class Author.
ii. Write the names of all the member functions which are accessible from objects belonging to class Branch.
iii. Write the names of all the members which are accessible from member functions of class Author.
iv. How many bytes will be required by an object belonging to class Author?
Q2: Answer the questions (i) to (iv) based on the following:
class Publisher
{
char pub[12];
double turnover;
protected:
void register();
public:
Publisher();
void enter();
void display();
};

class Branch
{
char city[20];
protected:
float employees;
public:
Branch();
void haveit();
void giveit();
};

class Author : private Branch, public Publisher
{
int acode;
char aname[20];
float amount;
public:
Author();
void start();
void show();
};
i. Write the names of data members, which are accessible from objects belonging to class Author.
ii. Write the names of all the member functions which are accessible from objects belonging to class Branch.
iii. Write the names of all the members which are accessible from member functions of class Author.
iv. How many bytes will be required by an object belonging to class Author?
Q1: Consider the following declarations and answer the question given below :
class Vehicle
{
private:
int wheels;
protected :
int passenger:
public :
void inputdata(int, int);
void outputdata();
};

class Heavyvehicle : protected Vehicle
{
int diesel_petrol;
protected :
int load;
public:
void readdata(int, int);
void writedata();
};

class Bus : private Heavyvehicle
{
char make[20];
public :
void fetchdata(char);
void displaydata();
};

(i) Name the base class and derived class of the class Heavyvehicle.
(ii) Name the data member(s) that can be accessed from function displaydata().
(iii) Name the data member's that can be accessed by an object of Bus class.
(iv) Is the member function outputdata() accessible to the objects of Heavyvehicle class.
Q1: Consider the following declarations and answer the question given below :
class Vehicle
{
private:
int wheels;
protected :
int passenger:
public :
void inputdata(int, int);
void outputdata();
};

class Heavyvehicle : protected Vehicle
{
int diesel_petrol;
protected :
int load;
public:
void readdata(int, int);
void writedata();
};

class Bus : private Heavyvehicle
{
char make[20];
public :
void fetchdata(char);
void displaydata();
};

(i) Name the base class and derived class of the class Heavyvehicle.
(ii) Name the data member(s) that can be accessed from function displaydata().
(iii) Name the data member's that can be accessed by an object of Bus class.
(iv) Is the member function outputdata() accessible to the objects of Heavyvehicle class.
Q2: Answer the questions (i) and (iii) after going through the following class:
class Seminar
{
int time;
public:
Seminar() //Function 1
{
time = 30;
cout << "Seminar starts now" << endl;
}
void lecture() //Function 2
{
cout << "Lectures in the seminar on" << endl;
}
Seminar(int duration) //Function 3
{
time = duration;
cout << "Seminar starts now" << endl;
}
~Seminar() //Function 4
{
cout << "Thanks" << endl;
}
};
i. Write statements in C++ that would execute Function 1 and Function 3 of class Seminar.
ii. In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called?
iii. In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together?

1.      What do you think are the importance of managing waste electrical and electronic equipment (WEEE)?

2.      How will you use the knowledge you acquired about 3Rs environmental policies?

3.      Cite a situation in which you can apply the knowledge of understanding 3Rs environmental policies.


   Cite a situation in which you can apply the knowledge of understanding 3Rs environmental policies.


LATEST TUTORIALS
APPROVED BY CLIENTS