Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have it where you can input the value but I cannot get thisprogram to run wher

ID: 3613461 • Letter: I

Question

I have it where you can input the value but I cannot get thisprogram to run where it gives me the total meals eaten at Subwayand Lazy Moon and what my balance is left over on the meal card.The Qiuestion is below and my work is under it.

Question:
You will prompt the user for the following information:
1. The cost of a meal at Subway (in dollars – must be aninteger).
2. The cost of a meal at Lazy Moon (in dollars – must be aninteger and greater than #1).
3. The number of meals you will need to eat for the semester.
4. The amount of money (in dollars – must be an integer) yourparents have put on your meal card.

Input Specification
1. The cost of both meals will be positive integers less than 20with the cost of a meal at Lazy Moon being more expensive than thecost of a meal at Subway.
2. The number of meals will be a positive integer less than300.
3. The amount of money your parents place on your meal card will bea positive integer that is somewhere in between the cost of eatingevery meal at Subway and the cost of eating every meal at LazyMoon, inclusive.

Sample Run
How much do you spend on a meal at Subway?
4
How much do you spend on a meal at Lazy Moon?
6
How many meals will you eat this semester?
150
How much money did your parents put on your meal card?
749
You will eat 76 meals at Subway and 74 meals at Lazy Moon.
You will have $1 left on your card.
______________________________________________________________________________

(MY WORK)

#include <stdio.h>

int main(void)
{
    int number_of_meals_eaten_at_subway,number_of_meals_eaten_at_Lazy_Moon, sas, salm, eat_this_semester,limit_on_meal_card;

   
    printf ("How much do you spend on a meal atsubway? ");
    scanf ("%d", &sas);
   
    printf ("How much do you spend on a meal at LazyMoon? ");
    scanf ("%d", &salm);
   
    printf ("How many meals will you eat thissemester? ");
    scanf ("%d", &eat_this_semester);
   
    printf ("How much money did your parents put onyour meal card? ");
    scanf ("%d",&limit_on_meal_card);   
   
    number_of_meals_eaten_at_subway =(eat_this_semester - salm*limit_on_meal_card)/(sas - salm);
    number_of_meals_eaten_at_Lazy_Moon =limit_on_meal_card - number_of_meals_eaten_at_subway;
   
    printf ("You will eat %d meals at subway and %dmeals at Lazy Moon ", number_of_meals_eaten_at_subway,
            number_of_meals_eaten_at_Lazy_Moon);
    printf ("You will have %d left on your card",limit_on_meal_card);
   
    getch ();
   
    return 0;
}

sas = spent at subway
salm = spent at Lazy moon

While doing this, I was trying to figure out the math and camealong with this:
Ax + By = C
x + y = D

where we have to solve for x and y. "A" would be spent at subwayand "B" would be spent at Lazy Moon and "C" would be eaten asemester and "D" would be Limit on meal card.

I got:
x = (c - bd)/(a - b)
y = d - b

I do not know if my math is wrong but I can not get what the Sampleis getting which is:
You will eat 76 meals at Subway and 74 meals at Lazy Moon.
You will have $1 left on your card.

Explanation / Answer

please rate - thanks you've got to shorten your variable names. made it muchharder to do #include #include int main(void) {     int number_of_meals_eaten_at_subway,number_of_meals_eaten_at_Lazy_Moon, sas, salm, eat_this_semester,limit_on_meal_card;     int left=0,spent;     printf ("How much do you spend on a meal atsubway? ");     scanf ("%d", &sas);     printf ("How much do you spend on a meal at LazyMoon? ");     scanf ("%d", &salm);     printf ("How many meals will you eat thissemester? ");     scanf ("%d", &eat_this_semester);     printf ("How much money did your parents put onyour meal card? ");     scanf ("%d", &limit_on_meal_card);    for(number_of_meals_eaten_at_subway=1;number_of_meals_eaten_at_subway