0% found this document useful (0 votes)
11 views4 pages

abstract questions

Rock is developing a real-time multiplayer game with an in-game messaging system that includes an abstract class Message and a subclass Email for sending messages. The program captures user input for sender, recipient, subject, and body of an email, then formats and displays this information. Wick is also creating a real-time strategy game that requires matrix operations for calculating army strength, involving an abstract class MatrixOperation and a class MatrixAddition to perform matrix addition.

Uploaded by

jetblackaqua957
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

abstract questions

Rock is developing a real-time multiplayer game with an in-game messaging system that includes an abstract class Message and a subclass Email for sending messages. The program captures user input for sender, recipient, subject, and body of an email, then formats and displays this information. Wick is also creating a real-time strategy game that requires matrix operations for calculating army strength, involving an abstract class MatrixOperation and a class MatrixAddition to perform matrix addition.

Uploaded by

jetblackaqua957
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ABSTRACT QUESTIONS

QUESTIONS 1

Problem Statement

Rock is developing a real-time multiplayer game where players can communicate with
each other through an in-game messaging system. The game features a messaging
system with an abstract class Message and a subclass Email for sending in-game
emails.

Develop a program to help Rock that solicits user input, capturing information such
as sender and recipient addresses, subject, and body of a message. Subsequently,
the program presents the collected details back to the user.

Input format :
The first line of input consists of a string, representing the sender's email
address.

The second line consists of a string, representing the recipient's email address.

The third line consists of a string, representing the subject of the mail.

The fourth line consists of a string, representing the body of the mail.

Output format :
The output displays the information about the mail in the following format:

"Email Format

From: [sender]

To: [recipient]

Subject: [subject]

Body: [body]

Email sent!"

Refer to the sample output for formatting specifications.

Code constraints :
The given test cases fall under the following constraints:

The maximum length of the string is 1000.

Sample test cases :


Input 1 :
JohnDoe
JaneSmith
Greetings
Hello Jane, how are you?
Output 1 :
Email Format
From: JohnDoe
To: JaneSmith
Subject: Greetings
Body: Hello Jane, how are you?
Email sent!
Input 2 :
Organizer
Players
Game Tomorrow
Friendly reminder about our Game tomorrow at 2 PM!
Output 2 :
Email Format
From: Organizer
To: Players
Subject: Game Tomorrow
Body: Friendly reminder about our Game tomorrow at 2 PM!
Email sent!

QUESTIONS 2

Problem Statement

Wick is developing a real-time strategy game where the players command armies
represented by square matrices. The game requires matrix operations to calculate
army strength and overall battle outcomes.

Write a program to assist Wich that includes an abstract class MatrixOperation with
an abstract method performOperation() and a class MatrixAddition. Calculate the
army strength by adding all the elements in the given matrices. Display the matrix
that represents the army's strength.
Input format :
The first line of input consists of an integer N, representing the number of rows
and columns of a square matrix.

The next N lines consist of N space-separated integers, representing the elements


of the first matrix.

The following N lines consist of N space-separated integers representing the


elements of another matrix.

Output format :
The output prints the army strength, which is the addition of the given matrices.

Refer to the sample output for formatting specifications.

Code constraints :
The given test cases fall under the following constraints:

1 ≤ N ≤ 5

1 ≤ Array elements ≤ 100

Sample test cases :


Input 1 :
2
1 2
3 4
5 6
7 8
Output 1 :
6 8
10 12
Input 2 :
3
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
Output 2 :
11 13 15
17 19 21
23 25 27
QUESTION 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy