hey i want to pass different times eg interval= c(24,24,48,48,72,72,72,24,24,48) after passing time, concerned time should go to its loop(24 in first, 48 in second and 72 in third loop) and give output how i can do this please guide
if(interval+1<=24){
print(" Urgent Package") # Assume terrain factor is 1
FPP=250 # Assume fixed price for parcel is 250
TC=100 # per hr price for time
fuelcost=117
for(loc in 1:10){
costofparceldelivery=250/10*fuelcost+FPP+TC*15/60*2
print(paste("cost of delivery on loc",loc,"Rs",costofparceldelivery))}
}else if(interval+1<=48){
print(" Premium Package")
FPP=250 # Assume fixed price for parcel is 250
TC=100 # per hr price for time
fuelcost=117
for(loc in 1:10){
costofparceldelivery=250/10*fuelcost+FPP+TC*15/60*1.5
print(paste("cost of delivery on loc",loc,"Rs",costofparceldelivery))}
}else if(interval+1<=72){
print(" Economy Package")
FPP=250 # Assume fixed price for parcel is 250
TC=100 # per hr price for time
fuelcost=117
for(loc in 1:10){
Dynamicpriceofloc = 250/10*fuelcost+FPP+TC*15/60
print(paste("Platform Profit Rs",platformprofit))}
}else{
print("Enter Valid Time")
}
thanks it works , however what if in same interval 2 different distances have to be incorporated eg total 24hrs periods are 4 and each contain different distance then how i can get output please help
Despite my previous ability to help you, i managed to do it ... without understanding what you are doing.
Something about the code you shared involves distances ?