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

May someone help me write a C program in which it follows these instructions. Th

ID: 2291552 • Letter: M

Question

May someone help me write a C program in which it follows these instructions. Thank you.

(a) The left hand side which must be a variable (b) The assignment operator,- (c) The right hand side which ca nbe any legal expression (d) A semicolon, which terminates the statement. The most complicatedpart is the RHS, for C allows expressions of various sorts (e.g. function calls, variables, constants, expressions involving arithmetic operators). But, we will limit the RHS to the one of the following (a) A constant (b) A variable (c) One function call, with only constants or variables as arguments (d) An expression with one binary arithmetic operator (+,-, *, /, %) in which the operands must be constants or variables. The following are examples of legal RHS of assignment operators under our rules X 12 x = fun( 12 ); X-y +z ; Y x+12 The following are examples of illegal RHS of assignment operators under our rules X - funl (fun2(x)); / illegal-nested function call */ X-y +z+ 10; /* illegal two operators */ X - funl(x) + z; /* illegal operand/ We allow any amount of white space to separate parts of the assignment statement. You may assume that no assignment statement consists of more than 50 characters including white space (a tab, blank, and newline counts as a single character) Write a program that promts the user to enter an assignment statement at the keyboardand then tests whether it is legal under our restrcuted syntax. Follow the C rules for identifiers, under which, for example, a variable's name may not begin with a number. The program echoes each statement as it is read and then prints out s message about its legality. The function main does only input, output. Use only getcharO for input. The rest of the work must be done by other function(s) Hint: The program needs to remember the previous character read so that the two can be compared. For example, the assignment statement's LHS may not consist of a letter, a white space, and another letter

Explanation / Answer

Now we want our code to be more specific is, it should follow the norms like a name cannot contain a number, phone number cannot be an alphabet etc.Let's try o code it -

getchar() return type is int but that doesn’t mean the returned value can’t be assigned to anything other than an int.

This is what we called validation which holds when we do registration for an account, the very best example is a email which asks for your name your phone number etc. I fyoutry to enter a numeric in name it displays below "please enter a valid name".

After registration if login into your account, if you enter wrong email I'd ( like gmial .cam etc) then validation is done in user end only, no database is required for such verification.

But when you enter password ad login the database and SQL coding plays a major role in verifying if the use name and password are matched or mismatched