add code to display the information of each part in addition to the total inventory value in a table format. Old part number is OLS0001, quantity 30 and price 0.80, 24 is total inverntory Expected output: SMS0001 0.35 20 7.00 OLS0001 0.80 30 24.00
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
add code to display the information of each part in addition to the total inventory value in a table format.
Old part number is OLS0001, quantity 30 and price 0.80, 24 is total inverntory
Expected output:
SMS0001 0.35 20 7.00
OLS0001 0.80 30 24.00
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main() {
struct partitem
{
char number[10];
float price;
};
struct partitem part, oldpart;
int oldpartqty;
float oldpartprice;
int qty = 20;
part.price = 0.35;
strcpy(part.number,"SMS0001");
printf("price = %.2f\n",part.price);
printf("name = %s \n", part.number);
printf("quantity %d \n",qty );
printf("enter oldpart\n");
scanf("\n %s",oldpart.number);
printf("\nold part number is %s",oldpart.number);
printf("\nold part price");
scanf( "%f",&oldpartprice);
printf("old part qty");
scanf("%d",&oldpartqty);
printf("the price of the old part is %.2f \n",oldpartprice);
printf("the qty of the old part is %d \n",oldpartqty);
return 0;
}
Step by step
Solved in 4 steps with 2 images