public class Main { public static void main(String[] args) { int[] haystack = {1,4,34,56,7}; int needle = 7;//search for element in array int index = -1; for (int i = 0; i < haystack.length; i++) { if (haystack[i] == needle) { index = i + 1; break; } } System.out.println("At position :" + index);Read more
public class Main {
public static void main(String[] args) {
int[] haystack = {1,4,34,56,7};
int needle = 7;//search for element in array
int index = -1;
for (int i = 0; i < haystack.length; i++) {
if (haystack[i] == needle) {
index = i + 1;
break;
}
}
System.out.println("At position :" + index);
}
}
#include <stdio.h> void main() { int array[10]; int i, j, num, temp, keynum; int low, mid, high; printf("Enter the value of num \n"); scanf("%d", &num); printf("Enter the elements one by one \n"); for (i = 0; i < num; i++) { scanf("%d", &array[i]); } printf("Input array elements \n"Read more
#include <stdio.h>
void main()
{
int array[10];
int i, j, num, temp, keynum;
int low, mid, high;
printf("Enter the value of num \n");
scanf("%d", &num);
printf("Enter the elements one by one \n");
for (i = 0; i < num; i++)
{
scanf("%d", &array[i]);
}
printf("Input array elements \n");
for (i = 0; i < num; i++)
{
printf("%d\n", array[i]);
}
/* Bubble sorting begins */
for (i = 0; i < num; i++)
{
for (j = 0; j < (num - i - 1); j++)
{
if (array[j] > array[j + 1])
{
temp = array[j];
array[j] = array[j + 1];
array[j + 1] = temp;
}
}
}
printf("Sorted array is...\n");
for (i = 0; i < num; i++)
{
printf("%d\n", array[i]);
}
printf("Enter the element to be searched \n");
scanf("%d", &keynum);
/* Binary searching begins */
low = 1;
high = num;
do
{
mid = (low + high) / 2;
if (keynum < array[mid])
high = mid - 1;
else if (keynum > array[mid])
low = mid + 1;
} while (keynum != array[mid] && low <= high);
if (keynum == array[mid])
{
printf("SEARCH SUCCESSFUL \n");
}
else
{
printf("SEARCH FAILED \n");
}
}
Let this interface be placed in a package called music. Write a class called Veena which implements Playable interface. Let this class be placed in a package music.string . . . . . DOWNLOAD ATTACHMENT FOR ANSWER:
Let this interface be placed in a package called music.
Write a class called Veena which implements Playable interface. Let this class be placed in a package music.string
RS 232 C The RS 232 C is a standard for serial data transfer. It specifies standard for 25 signals & hand shake signals which are used between DCE & DTE. The voltage levels, maximum capacitance for there signal lines are also described in this standard. The standard RS-232 C interface is usuRead more
RS 232 C
The RS 232 C is a standard for serial data transfer.
It specifies standard for 25 signals & hand shake signals which are used between DCE & DTE. The voltage levels, maximum capacitance for there signal lines are also described in this standard.
The standard RS-232 C interface is usually provided in computers for serial data transfer. A voltage between -3 V & -15 V under load is used for high logic or mark.
A voltage between +3 V & +15 V under load is used for low logic or space.
The voltage levels are not TTL compatible.
Magnet-Optical Storage Media
There are used for erasable disks. MO system includes basic principles of both magnetic & optical storage systems.
MO systems write magnetically & read optically.
It has two standard forms : 5.25 inches & 3.5 inches.
Flip Flops
A device is said to be bi-stable if it has 2 stable elements.
A flip-flop is a bi-stable device. It has 2 stable stales. Its O/P remains either high or low.
The high stable state is called SET. The other stable state is called RESET.
It can store binary bit,rather 0 or 1. Thus, it has storing capability, i.e., memory.
Shift Registers
In a shift register, the flip-flops are connected in series.
The O/P of each flip-flop is connected to the I/P of the adjacent flip flop.
The contents of a shift register can be shifted within the registers without changing the order of the bits.
Data are shifted one position left or right at a time when 1 clock pulse is applied. Shift register are used for the temporary storage of data. They are suited for processing serial data; converting serial data to parallel data & vice versa.
Write a program to initialize an integer array with values and check if a given number is present in the …
public class Main { public static void main(String[] args) { int[] haystack = {1,4,34,56,7}; int needle = 7;//search for element in array int index = -1; for (int i = 0; i < haystack.length; i++) { if (haystack[i] == needle) { index = i + 1; break; } } System.out.println("At position :" + index);Read more
Write a program to copy from one file to another. Sample Input and Output: Enter the input file name Input.txt …
FOLLOW THE LINK: https://sikshapath.in/question/write-a-program-to-copy-from-one-file-to-another/
FOLLOW THE LINK:
See lessWrite a menu driven program that implements Binary Search (for successful and unsuccessful search)
#include <stdio.h> void main() { int array[10]; int i, j, num, temp, keynum; int low, mid, high; printf("Enter the value of num \n"); scanf("%d", &num); printf("Enter the elements one by one \n"); for (i = 0; i < num; i++) { scanf("%d", &array[i]); } printf("Input array elements \n"Read more
Write an interface called Playable, with a method void play(); Let this interface be placed in a package called music. …
Let this interface be placed in a package called music. Write a class called Veena which implements Playable interface. Let this class be placed in a package music.string . . . . . DOWNLOAD ATTACHMENT FOR ANSWER:
Let this interface be placed in a package called music.
Write a class called Veena which implements Playable interface. Let this class be placed in a package music.string
. . . . .
DOWNLOAD ATTACHMENT FOR ANSWER:
See lessWrite a PL/SQL program to identify whether a character entered by user is letter or digit.
https://sikshapath.in/question/write-a-pl-sql-program-to-identify-whether-a-character-entered-by-user-is-letter-or-digit/
Explain about RS 232 C. What is Magnet-Optical Storage Media? What are Flip Flops? What are Shift Registers?
RS 232 C The RS 232 C is a standard for serial data transfer. It specifies standard for 25 signals & hand shake signals which are used between DCE & DTE. The voltage levels, maximum capacitance for there signal lines are also described in this standard. The standard RS-232 C interface is usuRead more
RS 232 C
The RS 232 C is a standard for serial data transfer.
It specifies standard for 25 signals & hand shake signals which are used between DCE & DTE. The voltage levels, maximum capacitance for there signal lines are also described in this standard.
The standard RS-232 C interface is usually provided in computers for serial data transfer. A voltage between -3 V & -15 V under load is used for high logic or mark.
A voltage between +3 V & +15 V under load is used for low logic or space.
The voltage levels are not TTL compatible.
Magnet-Optical Storage Media
There are used for erasable disks. MO system includes basic principles of both magnetic & optical storage systems.
MO systems write magnetically & read optically.
It has two standard forms : 5.25 inches & 3.5 inches.
Flip Flops
A device is said to be bi-stable if it has 2 stable elements.
A flip-flop is a bi-stable device. It has 2 stable stales. Its O/P remains either high or low.
The high stable state is called SET. The other stable state is called RESET.
It can store binary bit,rather 0 or 1. Thus, it has storing capability, i.e., memory.
Shift Registers
In a shift register, the flip-flops are connected in series.
The O/P of each flip-flop is connected to the I/P of the adjacent flip flop.
The contents of a shift register can be shifted within the registers without changing the order of the bits.
Data are shifted one position left or right at a time when 1 clock pulse is applied. Shift register are used for the temporary storage of data. They are suited for processing serial data; converting serial data to parallel data & vice versa.
Then are 4 types of shift registers.
(ii) Serial In – Serial Out
(iii) Serial In – Parallel Out
(iv) Parallel In – Serial Out
(v) Parallel In – Parallel Out
See less