1. Imagine a ridesharing application that helps its drivers to find customers and rewards
them based on their service.
What are the variables involved to calculate the total reward (earning) that will be
received by the driver of this ridesharing application from one transaction? (list out all
possible variables and the data type for each variable)
Jawab :
jarak integer
kenyamanan integer
reward integer
totalReward integer
2. Imagine there is an application that tracks and calculates the monthly expenses of a
university student.
What are the variables needed to create that application? (list out all possible
variables and the data type for each variable)
Jawab :
pendapataninteger
pengeluaran integer
barang string
hargaBarang integer
totalPengeluaraninteger
3. In order to ascend a skyscraper and see the city view from a height, each visitor is
required to purchase an entrance ticket. The price of this entrance ticket is vary based
on several conditions as follow:
If the visitor is a student, then the visitor will get a 20% discount from the total price
of an entrance ticket.
If the visitor is going to ascend the skyscraper on a weekend or a holiday, then the
ticket price is 20% more expensive than the regular one.
What are the variables needed to create a program that could calculate the total ticket
price that must be paid by a visitor of this skyscraper? (list out all possible variables
and the data type for each variable)
Jawab :
hargaTiket integer
jumlahTiket integer
, tipeCustomerstring
discount integer
waktuPergi string
4. Provided below are user input variables:
a. QTS (int)
b. midTerm (int)
c. QAS (int)
d. finalTerm (int)
Create an application to calculate the Final Score.
nts = 35% QTS + 65% midTerm
nas = 35% QAS + 65% finalTerm
finalScore = 40% nts + 60% nas
5. Provided below are user input variables:
, price (int)
payment (int)
Create an application to calculate the Change Money.
changeMoney = payment – price
6. Provided below are user input variables:
totalItem (int)
price (int)
Create an application to calculate the Total Payment.
totalPayment = price * totalItem
them based on their service.
What are the variables involved to calculate the total reward (earning) that will be
received by the driver of this ridesharing application from one transaction? (list out all
possible variables and the data type for each variable)
Jawab :
jarak integer
kenyamanan integer
reward integer
totalReward integer
2. Imagine there is an application that tracks and calculates the monthly expenses of a
university student.
What are the variables needed to create that application? (list out all possible
variables and the data type for each variable)
Jawab :
pendapataninteger
pengeluaran integer
barang string
hargaBarang integer
totalPengeluaraninteger
3. In order to ascend a skyscraper and see the city view from a height, each visitor is
required to purchase an entrance ticket. The price of this entrance ticket is vary based
on several conditions as follow:
If the visitor is a student, then the visitor will get a 20% discount from the total price
of an entrance ticket.
If the visitor is going to ascend the skyscraper on a weekend or a holiday, then the
ticket price is 20% more expensive than the regular one.
What are the variables needed to create a program that could calculate the total ticket
price that must be paid by a visitor of this skyscraper? (list out all possible variables
and the data type for each variable)
Jawab :
hargaTiket integer
jumlahTiket integer
, tipeCustomerstring
discount integer
waktuPergi string
4. Provided below are user input variables:
a. QTS (int)
b. midTerm (int)
c. QAS (int)
d. finalTerm (int)
Create an application to calculate the Final Score.
nts = 35% QTS + 65% midTerm
nas = 35% QAS + 65% finalTerm
finalScore = 40% nts + 60% nas
5. Provided below are user input variables:
, price (int)
payment (int)
Create an application to calculate the Change Money.
changeMoney = payment – price
6. Provided below are user input variables:
totalItem (int)
price (int)
Create an application to calculate the Total Payment.
totalPayment = price * totalItem