answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
blondinia
13 days ago
13

there is a structure called employee that holds information like employee code, name, date of joining. Write a program to create

an array of the structure and enter some data into it. Then ask the user to enter current date. Display the names of those employees whose service is 15 or more than 15 years according to the given current date.
Computers and Technology
1 answer:
oksian1 [950]13 days ago
3 0

Answer:

The following is the C program:

#include<stdio.h>

#include<conio.h>

struct employee{

char empname[50]; int empcode, day, mon, yr;

} employees[30];

int main(){

int total;

printf("Numbers of Employees: "); scanf("%d",&total);

for(int kt=0; kt<total; kt++){

printf("Employee Code: "); scanf("%d",&employees[kt].empcode);

printf("Name: "); scanf("%s", employees[kt].empname);

printf("Date of Joining [dd mm yyyy]: "); scanf("%d%d%d",&employees[kt].day,&employees[kt].mon,&employees[kt].yr); }

int year;

printf("\nCurrent Date [Year only]: "); scanf("%d", &year);

printf("Code\t\t\t Name\t\t\t Date of Joining\n");

for(int kt=0; kt<total; kt++)

if((year - employees[kt].yr) >= 15)

printf("%d\t\t\t %s\t\t\t %d/%d/%d\n", employees[kt].empcode, employees[kt].empname, employees[kt].day, employees[kt].mon, employees[kt].yr);

}

Explanation:

Refer to the attached document for clarification, including comments that elucidate certain lines

Download txt
You might be interested in
A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi
oksian1 [950]

Answer:

Below is the Python code with suitable comments.

Explanation:

#Input file name acquisition

filename=input('Enter the input file name: ')

#Opening the input file

inputFile = open(filename,"r+")

#Dictionary definition.

list={}

#Read and split file content using a loop

for word in inputFile.read().split():

#Check if the word exists in the file.

if word not in list:

list[word] = 1

#Increment count by 1

else:

list[word] += 1

#Closing the file.

inputFile.close();

#Output a blank line

print();

#Sorting words according to their ASCII values.

for i in sorted(list):

#Display unique words along with their

#frequencies in alphabetical order.

print("{0} {1} ".format(i, list[i]));

3 0
1 month ago
A company operates on two types of servers: 2 large servers (L) and 4 smaller servers (S), with a combined total of 64GB RAM. Th
oksian1 [950]

Reasoning:

Let's denote the size of a large server as L and the size of a smaller server as S.

According to the data provided, we have two equations:

2L + 4S = 64.............(1)

and

L + 3S = 40...............(2)

To solve the equations, we proceed as follows:

2(2)-(1)

2L - 2L + 6S - 4S = 2*40 - 64

2S = 16

thus, S = 8..................(3), which indicates the size of the small server

Using (3) in (2) yields

L + 3(8) = 40

L = 40 - 24 = 16..............indicating the size of the large server

8 0
26 days ago
To encourage good grades, Hermosa High School has decided to award each student a bookstore credit that is 10 times the student’
amid [951]

Answer:

// here's the Java code.

import java.util.*;

// definition of the class

class BookstoreCredit

{

/* method that prints a message including the name and grade point */

   public static void fun(String name,double grade)

   {

// multiplying grade by 10

       grade=grade*10;

// display the message

       System.out.println(name+"\'s average grade is $"+grade);

   }

// main method for the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner instance to read input

       Scanner s=new Scanner(System.in);

        // declaring variables

      String s_name;

      double grade;

      System.out.print("Please enter the name:");

      s_name=s.nextLine();

      System.out.print("Please enter the grade point:");

      grade=s.nextDouble();

   }catch(Exception ex){

       return;}

}

}

Explanation:

Define a string variable named s_name and a double variable named grade. Obtain the name and grade from the user, then invoke the fun() method with these parameters, which will multiply the grade by 10 and output a message that includes the student's name along with their average grade.

Output:

Please enter the name:john

Please enter the grade point:3.2

john's average grade is $32.0

7 0
1 month ago
Which of the following is an absolute cell reference
Amiraneli [1052]
The term for the contents of the cell is an absolute cell reference. Excel allows each cell to contain numbers, strings, or formulas. Users can enter values into a cell and apply built-in formulas to perform calculations and obtain results in the target cell. When users attempt to copy and paste data into another cell, they can use the paste special option to select values, meaning that only the data is copied, excluding the formula; this is known as the absolute reference of the cell. With paste special, users can also replicate images or Unicode.
6 0
1 month ago
python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
oksian1 [950]

int currentNumber,previousNumber = -1, countDuplicates = 0;

do {

cin >> currentNumber;

if ( previousNumber == -1) {

previousNumber = currentNumber;

}else {

if ( previousNumber == currentNumber )

countDuplicates++;

else

previousNumber = currentNumber;

}

} while(currentNumber > 0 );

cout << countDuplicates;

7 0
1 month ago
Other questions:
  • In cell F15, insert a function that will automatically display the word Discontinue if the value in cell D15 is less than 1500,
    6·1 answer
  • Why computer is known as versatile and diligent device ?explain​
    14·1 answer
  • Two middle-order batsmen are compared based on their performance in their previous cricket match.
    7·1 answer
  • Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input.
    6·1 answer
  • When a CPU executes instructions as it converts input into output, it does so with
    12·1 answer
  • Write an expression that will cause the following code to print "18 or less" if the value of user_age is 18 or less. Write only
    9·2 answers
  • Allison wants to use equations to simplify the process of explaining something to the Sales team, but the default eq
    8·2 answers
  • According to the book, if your CPU usage levels are greater than ________ during most of your work session, a faster CPU can gre
    6·1 answer
  • The act of infiltrating a remote computer system is called​
    14·1 answer
  • You just read an msds for acetic acid. based on what you read, what type of information is included in an msds sheet? record you
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!