What's new

C & C++ Patulong mga lods

Frenzo125

Forum Veteran
Elite
Joined
May 22, 2016
Posts
1,406
Solutions
46
Reaction
2,416
Points
790
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
 

Attachments

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
 

Similar threads

Back
Top