🔒 Closed Patulong mga lods

Status
Not open for further replies.

Frenzo125

Forum Veteran
Pa tulong mga lods diko makuha kung pano to ma code. Wala po kasi example input/output eh salamat po.
Nasa selection structure na po kami
Screenshot_20221023_193044.jpg
 
Sa understanding ko, need mo lang kunin yung expense. Since yun lang yung info i-assume natin na yung tax is yung magiging expense kasi yun lang yung binigay na data.

C++:
float profit;
float expenses;

if(profit >= 0 && profit <= 10000) {
    expenses = 0;
} else if (profit >= 10001 && profit <= 30000) {
    float taxrate = profit * 0.03;
    expenses = 100 + taxrate;
} else if (profit >= 30001 && profit <= 20000) {
    float taxrate = profit * 0.05;
    expenses = 200 + taxrate;
} // and so on and so forth, you get the idea.
 
Sa understanding ko, need mo lang kunin yung expense. Since yun lang yung info i-assume natin na yung tax is yung magiging expense kasi yun lang yung binigay na data.

C++:
float profit;
float expenses;

if(profit >= 0 && profit <= 10000) {
    expenses = 0;
} else if (profit >= 10001 && profit <= 30000) {
    float taxrate = profit * 0.03;
    expenses = 100 + taxrate;
} else if (profit >= 30001 && profit <= 20000) {
    float taxrate = profit * 0.05;
    expenses = 200 + taxrate;
} // and so on and so forth, you get the idea.
so yung value po na need ma input is yung profit lang po?
Sa understanding ko, need mo lang kunin yung expense. Since yun lang yung info i-assume natin na yung tax is yung magiging expense kasi yun lang yung binigay na data.

C++:
float profit;
float expenses;

if(profit >= 0 && profit <= 10000) {
    expenses = 0;
} else if (profit >= 10001 && profit <= 30000) {
    float taxrate = profit * 0.03;
    expenses = 100 + taxrate;
} else if (profit >= 30001 && profit <= 20000) {
    float taxrate = profit * 0.05;
    expenses = 200 + taxrate;
} // and so on and so forth, you get the idea.
Thanks po, ganyan talaga daw po gagawin
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 742
    Views
  • 3
    Participants
Last reply from:
Frenzo125

Trending Topics

Online now

Members online
1,122
Guests online
5,340
Total visitors
6,462

Forum statistics

Threads
2,353,836
Posts
29,381,231
Members
1,081,155
Latest member
EmiIy
Back
Top