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);
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 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...
C++ (data structure using c++). please send me copyable file. Write a program and test a...
C++ (data structure using c++). please send me copyable file. Write a program and test a program that translates the following Bubble Sort algorithm to a bubblesort function. The function's prototype is, void bubblesort(int a[], int size); Bubble Sort The inner loop moves the largest element in the unsorted part of the array to the last position of the unsorted part of the array; the outer loop moves the last position of the unsorted part of the array. The Bubble...
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/C++ program that simulate a menu based binary numbercalculator. This calculate shall have...
Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three functionalities:Covert a binary string to corresponding positive integersConvert a positive integer to its binary representationAdd two binary numbers, both numbers are represented as a string of 0s and 1sTo reduce student work load, a start file CSCIProjOneHandout.cpp is given. In this file, the structure of the program has been established. The students only need to implement the following three functions:int binary_to_decimal(string...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT