Question

In: Computer Science

write a c program of an structure based on rings(jewelry)

write a c program of an structure based on rings(jewelry)

Solutions

Expert Solution


#include <stdio.h>

int main()
{
struct rings{
float weight;
float carots;
char material[10];
}r1;
  
printf("Enter weight of ring r1 :");
scanf("%f",&r1.weight);
printf("\nEnter carots of ring r1 : ");
scanf("%f",&r1.carots);
printf("Enter material yellow gold or rose gold or white gold : ");
scanf("%s",r1.material);
  
printf("GOLD RING FEATURES");
printf("WEIGHT = %.2f\nCAROTS = %.2f\nMATERIAL = %s",r1.weight,r1.carots,r1.material);
return 0;
}


Related Solutions

write a Program in C++ Using a structure (struct) for a timeType, create a program to...
write a Program in C++ Using a structure (struct) for a timeType, create a program to read in 2 times into structures, and call the method addTime, in the format: t3 = addTime(t1, t2); Make sure to use add the code to reset and carry, when adding 2 times. Also, display the resultant time using a function: display(t3);
C++ programming Program 1: Write a program that uses a structure to store the following weather...
C++ programming Program 1: Write a program that uses a structure to store the following weather data for a particular month: Total Rainfall High Temperature Low Temperature Average Temperature The program should have an array of 12 structures to hold weather data for an entire year. When the program runs, it should ask the user to enter data for each month (the avg temperature should be calculated.) Once the data are entered for all the months, the program should calculate...
In c++, using stack structure, write a program that will take a sequence of characters (string)...
In c++, using stack structure, write a program that will take a sequence of characters (string) and determine whether it is a palindrome. Use the linked version of the stack.
Write a C program that contains a structure that uses predefined types and union. • Create...
Write a C program that contains a structure that uses predefined types and union. • Create a struct with name, age, kind (Either child, college student, or adult), and kindOfPerson (Either kid, student, or adult) • kids have a school field. Students have college and gpa. Adults have company and salary. • Create one non-dynamic struct with the content for a college student: "Bob", 20, K-State, 3.5 • Create one struct dynamically for a kid with: "Alison", 10, "Amanda Arnold...
Write a C program that creates a structure and displays its content. • Create a struct...
Write a C program that creates a structure and displays its content. • Create a struct that will be used to hold a student's name, age, and year in school (Freshman, Sophomore, Junior, or Senior) • Within function main, dynamically allocate space to hold the structure and assign a pointer to point to the memory space allocated • Read in (from the keyboard) the student's name, age, and year in school • Create a separate function with the prototype: void...
A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price...
A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price of $8.00 per stone for quantities of 600 stones or more, $8.30 per stone for orders of 400 to 599 stones, and $10 per stone for lesser quantities. The jewelry firm operates 175 days per year. Usage rate is 25 stones per day, and ordering costs are $48. a. If carrying costs are $2 per year for each stone, find the order quantity that...
A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price...
A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price of $8.40 per stone for quantities of 600 stones or more, $8.80 per stone for orders of 400 to 599 stones, and $9.30 per stone for lesser quantities. The jewelry firm operates 113 days per year. Usage rate is 20 stones per day, and ordering costs are $51. a. If carrying costs are $2 per year for each stone, find the order quantity that...
EOQ. A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a...
EOQ. A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price of $8 per stone for quantities of 600 stones or more, $9 per stone for orders of 400 to 599 stones, and $10 per stone for lesser quantities. The jewelry firm operates 200 days a year. Daily demand is 200 stoned per day, and ordering cost are $48. If carrying cost are $2 per year per stone, find the order quantity that will...
A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price...
A jewelry firm buys semiprecious stones to make bracelets and rings. The supplier quotes a price of $8.20 per stone for quantities of 600 stones or more, $8.70 per stone for orders of 400 to 599 stones, and $10 per stone for lesser quantities. The jewelry firm operates 214 days per year. Usage rate is 25 stones per day, and ordering costs are $48. a. If carrying costs are $2 per year for each stone, find the order quantity that...
Write a C program that will read a character string and then encrypt the string based...
Write a C program that will read a character string and then encrypt the string based on one of the 3 different encryption methods. The type of encryption is to be selected by the user. Encryption method 1: Swapping by position. Characters in the array are swapped with the opposite characters based on their position in the string. Example: Input string – apple. Encrypted string – elppa Method: The first character ‘a’ and the last character ‘e’ – swap their...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT