Answer:
Follows are the code to the given question:
class BankAccount //defining a class BankAccount
{
int balance;//defining integer variable balance
String name;//defining String variable name
BankAccount()//defining default constructor
{
}
BankAccount(int balance, String name)//defining parameterized constructor that accepts two parameters
{
this.balance = balance;//use this to hold parameter value
this.name = name;//use this to hold parameter value
}
}
public class Main//defining Main class
{
public static void main(String[] asr)//main method
{
BankAccount obv = new BankAccount(1969, "Mustang");//creating class object and pass value in parameter
System.out.println("Your name is: " + obv.name + " and " +"Your balance is: "+ obv.balance);//print value with message
}
}
Output:
Your name is: Mustang and Your balance is: 1969
Explanation:
In this code a class "BankAccount" is declared, that defines the two variable "name and balance" as a integer and string, and in the next step a parameterized constructor is declared, that uses this keyword to hold value.
In the main class the main method is declared and inside the method class object is created that accepts parameter value and use the print method to print its value.
ERIC'S Company sells cement at 30.0 Ghana Cedis per bag. The company
however gives discount of 15% for customers that buy 100 or more bags, and 0% for
customers that buy less than 100 bags.
Write a pseudo code and present a flowchart that
will display the discount percentage when the quantity of bags purchased is entered.
Answer:
The pseudocode is as follows:
Input Quantity
Discount = 0%
If Quantity >= 100:
Discount = 15%
Print Discount
See attachment for flowchart
Explanation:
This line gets the quantity from the user
Input Quantity
This line initializes the discount to 0%
Discount = 0%
This checks if quantity is more than or equal to 100
If Quantity >= 100:
If yes, discount is set to 15%
Discount = 15%
This prints the discount percentage
Print Discount
See attachment for flowchart
BitTorrent, a P2P protocol for file distribution, depends on a centralized resource allocation mechanism through which peers are able to maximize their download rates.
True or False?
Answer:
yes. it is true. mark as brainlest