Description
Write piece of code (function) that arranges char elements in binary file in alphabetical order.
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Here is source code of the C program to sort the names in analphabetical order. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
/*
* C program to read N names, store them in the form of an array
* and sort them in alphabetical order. Output the given names and
* the sorted names in two columns side by side.
*/
#include <stdio.h>
#include <string.h>
void main()
{
char name[10][8], tname[10][8], temp[8];
int i, j, n;
printf("Enter the value of n \n");
scanf("%d", &n);
printf("Enter %d names n", \n);
for (i = 0; i < n; i++)
{
scanf("%s", name[i]);
strcpy(tname[i], name[i]);
}
for (i = 0; i < n - 1 ; i++)
{
for (j = i + 1; j < n; j++)
{
if (strcmp(name[i], name[j]) > 0)
{
strcpy(temp, name[i]);
strcpy(name[i], name[j]);
strcpy(name[j], temp);
}
}
}
printf("\n----------------------------------------\n");
printf("Input NamestSorted names\n");
printf("------------------------------------------\n");
for (i = 0; i < n; i++)
{
printf("%s\t\t%s\n", tname[i], name[i]);
}
printf("------------------------------------------\n");
}
$ cc pgm32.c $ a.out Enter the value of n 7 Enter 7 names heap stack queue object class program project ---------------------------------------- Input Names Sorted names ------------------------------------------ heap class stack heap queue object object program class project program queue project stack
Completion Status:
100%
Review
Review
Anonymous
Really great stuff, couldn't ask for more.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
SQL Database Assignment
This is broken into three sections: Part A, is question based, whereas Part B relies on a query, and questions based on th ...
SQL Database Assignment
This is broken into three sections: Part A, is question based, whereas Part B relies on a query, and questions based on the query. The third part is based on using a database, writing code, and explaining parts of the code. Please, no plagiarism, it must be at a university standard. See below, attached is the script to create the database for the Assignment 10 SQL portion of the assignment.Assignment Week 10Part aSuppose you are a manufacturer of product ABC, which is composed of parts A, B, and C. Each time a new product is created, it must be added to the product inventory, using the PROD_QOH in a table named PRODUCT. And each time the product ABC is created, the parts inventory, using PART_QOH in a table named PART, must be reduced by one each of parts A, B, and C. The sample database contents are shown in Table P10.1Table P10.1 The Database for Problem 1Table name: PRODUCT Table name: PARTPROD_CODEPROD_QOH PART_CODEPART_QOHABC1,205 A567 B498 C549Given that information, answer the following questions.1. How many database requests can you identify for an inventory update for both PRODUCT and PART?2. Using SQL, write each database request you identified in problem 1.
3. Write the complete transaction(s) all of the above in a batch transaction.
Part b
Based on the following query:
SELECT P_CODE, P_QOH*P_PRICEFROM PRODUCTWHERE P_QOH*P_PRICE > (SELECT AVG(P_QOH*P_PRICE) FROM PRODUCT)
1. What is the likely data sparsity of the P_QOH and P_PRICE columns?
2. Should you create an index, what would the index column(s) be, and why should you create that index?(50 Points)Assignment Week 10 SQLAccomplish the following exercise and copy/paste the results into your week 10 assignment submission Word document. Using ch10_abc_markets database, write the SQL code to select the invoice year from inv_date with the column name invoiceYear, the invoice month from inv_date with the column name invoiceMonth, the invoice day from inv_date with the column name invoiceDay, and the sum of the invoice total with the column name invoiceTotal from the invoice table. Group the results by year, month, and day using the ROLLUP subclause. QUESTION: What does the rollup subclause provide in terms of grouping and how does it differ from the CUBE subclause? Using ch10_abc_markets database and line table, write the SQL code to select the invoice number, line number and the sum of the line price as sumLP. Group the results using grouping sets of invoice number and line number to show the sumLP by invoice number order. QUESTION: What is the purpose of the GROUPING SETS subclause and what is its primary use?Once you have accomplished that action, paste the script into your assignment submission document for this part of your assignment. (25 Points)
ITS 83441 University of the Cumberlands Emerging Cyber Threats Paper
Subject: ITS834 - Emerging Threats & CountermeasuresTopic:For this assignment, review the article:Abomhara, M., & Koien, ...
ITS 83441 University of the Cumberlands Emerging Cyber Threats Paper
Subject: ITS834 - Emerging Threats & CountermeasuresTopic:For this assignment, review the article:Abomhara, M., & Koien, G.M. (2015). Cyber security and the internet of things: Vulnerabilities, threats, intruders, and attacks. Journal of Cyber Security, 4, 65-88. Doi: 10.13052/jcsm2245-1439.414Address the following:What did the authors investigate, and in general how did they do so?Identify the hypothesis or question being testedSummarize the overall article.Identify the conclusions of the authorsIndicate whether or not you think the data support their conclusions/hypothesisConsider alternative explanations for the resultsProvide any additional comments pertaining to other approaches to testing their hypothesis (logical follow-up studies to build on, confirm or refute the conclusions)The relevance or importance of the studyThe appropriateness of the experimental designWhen you write your evaluation, be brief and concise, this is not meant to be an essay but an objective evaluation that one can read very easily and quickly. Also, you should include a complete reference (title, authors, journal, issue, pages) you turn in your evaluation. This is good practice for your literature review, which you’ll be completing during the dissertation process.Your paper should meet the following requirements:Be approximately four to six pages in length, not including the required cover page and reference page.Follow APA 7 guidelines. Your paper should include an introduction, a body with fully developed content, and a conclusion.Support your answers with the readings from the course and at least two scholarly journal articles to support your positions, claims, and observations, in addition to your textbook. The UC Library is a great place to find resources.Be clearly and well-written, concise, and logical, using excellent grammar and style techniques. You are being graded in part on the quality of your writing.
COSC 2425 NLC Movie Rank Classification & Review Assembly Language Program System
On this assignment you have to write simple assembly language. I have uploaded a instruction on doc file and txt file(requ ...
COSC 2425 NLC Movie Rank Classification & Review Assembly Language Program System
On this assignment you have to write simple assembly language. I have uploaded a instruction on doc file and txt file(required). For the reference I have also uploaded the guidance section 9.4.2 and 11.1.8 pdf file to make it easier.
11 pages
Us Stock Market 2019 2020
In this notebook, we introduce a dataset containing the monthly returns of US Stocks from 20192020. We open a csv dataset ...
Us Stock Market 2019 2020
In this notebook, we introduce a dataset containing the monthly returns of US Stocks from 20192020. We open a csv dataset that is related to the ...
ISSC 422 AMU Security Education & Training Discussion
Discussion Forum – Security Education & Training What avenues should an aspiring information security professional use ...
ISSC 422 AMU Security Education & Training Discussion
Discussion Forum – Security Education & Training What avenues should an aspiring information security professional use in acquiring professional credentials? Video Sources: Security Education and Training Requirements Top 10 IT Certifications for Security Cleared Professionals What a CompTIA Security+ Certification Can Do For YouHow to pass IT certifications
4 pages
Write Discussion
1. DISCUSSION FOCUSING ON WHAT IS THE BEST MOTHERBOARD AND The motherboard provides the 'hub' of your computer that everyt ...
Write Discussion
1. DISCUSSION FOCUSING ON WHAT IS THE BEST MOTHERBOARD AND The motherboard provides the 'hub' of your computer that everything else plugs into-it acts ...
Similar Content
COP 1334C Broward College Weston Lab 7 Lo Shu Magic Square Project
I need a program following the guidelines in the document post written using C++, please....
De Paul University Apartment Rent Caclulater in Python Paper
Homework3 (25pts)
Part 1 (15pts): Create a class named Apartment that holds an apartment number,
number of bedrooms, numbe...
Math and Algorithms Cocalc Platform & Sanket Pandhare C Programming Exercise
This homework is C++ programming and we do it on cocalc platform https://cocalc.com/. this platform is really easy to use...
Please submit a screen shot of Recon NG with as many API keys as you can find
Please submit a screen shot of Recon NG with as many API keys as you can find...
Enterprise Database Design Walden University Migrating to A New Sales System HW
Migrating to a New Sales SystemYour original company’s database was created using MS SQL. Your company merged with anoth...
Case Study
In 1300 words, answer the following questions with three scholarly sources using the attached information.1. In a narrativ...
Ex03
[X,Y] = meshgrid(-5:0.5:5);% Defining the xy grid of interest Z = (X-2).^2+2*X.*Y+Y.^2;% Defining the Z = f(X,Y) array...
20170604153950quality Process Improvement Tools And Techniques 1
Process improvement plays a very vital role in the organization. There are various tools and techniques that are most comm...
Answers
1. What similarities and differences do you find in the two cases? 1. Both case studies are solving real world problem. On...
Related Tags
Book Guides
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
SQL Database Assignment
This is broken into three sections: Part A, is question based, whereas Part B relies on a query, and questions based on th ...
SQL Database Assignment
This is broken into three sections: Part A, is question based, whereas Part B relies on a query, and questions based on the query. The third part is based on using a database, writing code, and explaining parts of the code. Please, no plagiarism, it must be at a university standard. See below, attached is the script to create the database for the Assignment 10 SQL portion of the assignment.Assignment Week 10Part aSuppose you are a manufacturer of product ABC, which is composed of parts A, B, and C. Each time a new product is created, it must be added to the product inventory, using the PROD_QOH in a table named PRODUCT. And each time the product ABC is created, the parts inventory, using PART_QOH in a table named PART, must be reduced by one each of parts A, B, and C. The sample database contents are shown in Table P10.1Table P10.1 The Database for Problem 1Table name: PRODUCT Table name: PARTPROD_CODEPROD_QOH PART_CODEPART_QOHABC1,205 A567 B498 C549Given that information, answer the following questions.1. How many database requests can you identify for an inventory update for both PRODUCT and PART?2. Using SQL, write each database request you identified in problem 1.
3. Write the complete transaction(s) all of the above in a batch transaction.
Part b
Based on the following query:
SELECT P_CODE, P_QOH*P_PRICEFROM PRODUCTWHERE P_QOH*P_PRICE > (SELECT AVG(P_QOH*P_PRICE) FROM PRODUCT)
1. What is the likely data sparsity of the P_QOH and P_PRICE columns?
2. Should you create an index, what would the index column(s) be, and why should you create that index?(50 Points)Assignment Week 10 SQLAccomplish the following exercise and copy/paste the results into your week 10 assignment submission Word document. Using ch10_abc_markets database, write the SQL code to select the invoice year from inv_date with the column name invoiceYear, the invoice month from inv_date with the column name invoiceMonth, the invoice day from inv_date with the column name invoiceDay, and the sum of the invoice total with the column name invoiceTotal from the invoice table. Group the results by year, month, and day using the ROLLUP subclause. QUESTION: What does the rollup subclause provide in terms of grouping and how does it differ from the CUBE subclause? Using ch10_abc_markets database and line table, write the SQL code to select the invoice number, line number and the sum of the line price as sumLP. Group the results using grouping sets of invoice number and line number to show the sumLP by invoice number order. QUESTION: What is the purpose of the GROUPING SETS subclause and what is its primary use?Once you have accomplished that action, paste the script into your assignment submission document for this part of your assignment. (25 Points)
ITS 83441 University of the Cumberlands Emerging Cyber Threats Paper
Subject: ITS834 - Emerging Threats & CountermeasuresTopic:For this assignment, review the article:Abomhara, M., & Koien, ...
ITS 83441 University of the Cumberlands Emerging Cyber Threats Paper
Subject: ITS834 - Emerging Threats & CountermeasuresTopic:For this assignment, review the article:Abomhara, M., & Koien, G.M. (2015). Cyber security and the internet of things: Vulnerabilities, threats, intruders, and attacks. Journal of Cyber Security, 4, 65-88. Doi: 10.13052/jcsm2245-1439.414Address the following:What did the authors investigate, and in general how did they do so?Identify the hypothesis or question being testedSummarize the overall article.Identify the conclusions of the authorsIndicate whether or not you think the data support their conclusions/hypothesisConsider alternative explanations for the resultsProvide any additional comments pertaining to other approaches to testing their hypothesis (logical follow-up studies to build on, confirm or refute the conclusions)The relevance or importance of the studyThe appropriateness of the experimental designWhen you write your evaluation, be brief and concise, this is not meant to be an essay but an objective evaluation that one can read very easily and quickly. Also, you should include a complete reference (title, authors, journal, issue, pages) you turn in your evaluation. This is good practice for your literature review, which you’ll be completing during the dissertation process.Your paper should meet the following requirements:Be approximately four to six pages in length, not including the required cover page and reference page.Follow APA 7 guidelines. Your paper should include an introduction, a body with fully developed content, and a conclusion.Support your answers with the readings from the course and at least two scholarly journal articles to support your positions, claims, and observations, in addition to your textbook. The UC Library is a great place to find resources.Be clearly and well-written, concise, and logical, using excellent grammar and style techniques. You are being graded in part on the quality of your writing.
COSC 2425 NLC Movie Rank Classification & Review Assembly Language Program System
On this assignment you have to write simple assembly language. I have uploaded a instruction on doc file and txt file(requ ...
COSC 2425 NLC Movie Rank Classification & Review Assembly Language Program System
On this assignment you have to write simple assembly language. I have uploaded a instruction on doc file and txt file(required). For the reference I have also uploaded the guidance section 9.4.2 and 11.1.8 pdf file to make it easier.
11 pages
Us Stock Market 2019 2020
In this notebook, we introduce a dataset containing the monthly returns of US Stocks from 20192020. We open a csv dataset ...
Us Stock Market 2019 2020
In this notebook, we introduce a dataset containing the monthly returns of US Stocks from 20192020. We open a csv dataset that is related to the ...
ISSC 422 AMU Security Education & Training Discussion
Discussion Forum – Security Education & Training What avenues should an aspiring information security professional use ...
ISSC 422 AMU Security Education & Training Discussion
Discussion Forum – Security Education & Training What avenues should an aspiring information security professional use in acquiring professional credentials? Video Sources: Security Education and Training Requirements Top 10 IT Certifications for Security Cleared Professionals What a CompTIA Security+ Certification Can Do For YouHow to pass IT certifications
4 pages
Write Discussion
1. DISCUSSION FOCUSING ON WHAT IS THE BEST MOTHERBOARD AND The motherboard provides the 'hub' of your computer that everyt ...
Write Discussion
1. DISCUSSION FOCUSING ON WHAT IS THE BEST MOTHERBOARD AND The motherboard provides the 'hub' of your computer that everything else plugs into-it acts ...
Earn money selling
your Study Documents