Revisit your program for assignment 1. Modify it so that the user can enter the number of elements for Oxygen, Carbon, Nitrogen, Sulfur, and Hydrogen and then your program outputs the matching amino acid and molecular weight. Your program should only be able to match one of the following from Table 2.8:
- Asparagine
- Glutamine
- Glycine
- Methionine
- Valine
If your program cannot match the molecules to an amino acid, it outputs “No Match Found”.
For example:
Enter the number of Molecules (O, C, N, S, H): 2, 2, 1, 0, 5
The matching amino acid is Glycine. Its molecular weight is ???.??
Note: ???.?? should be replaced with the molecular weight for the amino acid
Assignment #1
#include <stdio.h>
#define OXYGEN 15.9994
#define CARBON 12.011
#define NITROGEN 14.00674
#define HYDROGEN 1.00794
int main()
{
double glycine;
double glutamic;
double glutamine;
glycine = 2*OXYGEN + 2*CARBON + NITROGEN + 5*HYDROGEN;
glutamic = 4*OXYGEN + 5*CARBON + NITROGEN + 8*HYDROGEN;
glutamine = 3*OXYGEN + 5*CARBON + 2*NITROGEN + 10*HYDROGEN;
printf(“The molecular weight of glycine is %4.2f n”,glycine);
printf(“The molecular weight of glutamic is %4.2f n”,glutamic);
printf(“The molecular weight of glutamine is %4.3f n”,glutamine);
return 0;
}
Looking for solution of this Assignment?
WHY CHOOSE US?
We deliver quality original papers |
Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected |
Free revisions |
We offer our clients multiple free revisions just to ensure you get what you want. |
Discounted prices |
All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount |
100% originality |
We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI |
On-time delivery |
We will deliver your paper on time even on short notice or short deadline, overnight essay or even an urgent essay |