Automation QA Testing Course Content

HackerRank Program -Strings #1

 There is a sequence of words in CamelCase as a string of letters, , having the following properties:

  • It is a concatenation of one or more words consisting of English letters.
  • All letters in the first word are lowercase.
  • For each of the subsequent words, the first letter is uppercase and rest of the letters are lowercase.

Given , determine the number of words in .

Example

There are  words in the string: 'one', 'Two', 'Three'.

Function Description

Complete the camelcase function in the editor below.

camelcase has the following parameter(s):

  • string s: the string to analyze

Returns

  • int: the number of words in 

Input Format

A single line containing string .

Constraints

Sample Input

saveChangesInTheEditor

Sample Output

5

Explanation

String  contains five words:

  1. save
  2. Changes
  3. In
  4. The
  5. Editor


// Java code to find the count of words 
// in a CamelCase sequence 
class solution 

// Function to find the count of words 
// in a CamelCase sequence 
static int countWords(String str) 
int count = 1; 

for (int i = 1; i < str.length() - 1; i++) { 
if (str.charAt(i)>=65&&str.charAt(i)<=90) 
count++; 

return count; 

// Driver code 
public static void main(String args[]) 
String str = "saveChangesInTheEditor"; 

System.out.print( countWords(str)); 


===================================================================================
// Java program to convert given sentence 
/// to camel case. 
class GFG 

// Function to remove spaces and convert 
// into camel case 
static String convert(String s) 

// to count spaces 
int cnt= 0; 
int n = s.length(); 
char ch[] = s.toCharArray(); 
int res_ind = 0; 

for (int i = 0; i < n; i++) 

// check for spaces in the sentence 
if (ch[i] == ' ') 
cnt++; 
// conversion into upper case 
ch[i + 1] = Character.toUpperCase(ch[i + 1]); 
continue; 

// If not space, copy character 
else
ch[res_ind++] = ch[i]; 

// new string will be resuced by the 
// size of spaces in the original string 
return String.valueOf(ch, 0, n - cnt); 

// Driver code 
public static void main(String args[]) 
String str = "save  Changes In The Editor"; 
System.out.println(convert(str)); 





Computer Basics And Parts

 What is a Computer?

an electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program.

Parts of a computer with their functions

1. The computer case


This is the part that holds all of the internal components to make up the computer itself.

It is usually designed in such a manner to make fitting a motherboard, wiring, and drives as easy as possible. Some are designed so well that it is easy to make everything look tidy and presentable too.

Cases come in all different shapes and sizes to accommodate various types of computer components and to satisfy the needs of the consumer.

Design elements can vary from being plain to extremely elaborate. You can get a plain grey case or one that has colored lighting everywhere to make it looks spectacular.

Cases, like most things, vary in quality. You can get them made from cheap metals or from good quality materials that provide you with a sturdy design.


List of computer case sizes (known as form factor):

  • Very small form factor: Supports Mini ITX motherboards
  • Small form factor: Supports micro ATX motherboards.
  • Standard form factor: Supports standard ATX motherboards.
  • Larger form factors: Supports ATX and XL-ATX motherboards.

2. Motherboard

The motherboard is the main board that is screwed directly inside the computer case.

All other cards and everything else plugs directly into the motherboard, hence its name.

The CPU, RAM, drives, power supply and more all get connected to it.

Its function is to integrate all the components with each other so they can communicate and operate together.

A good motherboard offers a wide amount of connectivity options. It also has the least amount of bottlenecks as possible. This allows all the components to operate efficiently and to fulfill their maximum potential as they were designed to do.

Obviously, as the physical size of a motherboard is reduced, it begins to limit connectivity options and functionality.

Motherboards come in the following sizes:

MotherboardDimensions
Pico-ITX3.9 inch x 2.9 inch | 100mm x 72mm
Nano-ITX4.7 inch x 4.7 inch | 120mm x 120mm
Mini-ITX6.7 inch x 6.7 inch | 170mm x 170mm
Micro-ATX9.6 inch x 9.6 inch | 244mm x 244mm
Standard-ATX12 inch x 9.6 inch | 305mm x 244mm
XL-ATXEVGA: 13.5 inch x 10.3 inch | 343mm x 262mm
Gigabyte: 13.58 inch x 10.31 inch | 345mm x 262mm
Micro-Star: 13.6 inch x 10.4 inch | 345mm x 264mm

3. CPU: Central Processing Unit



The CPU is basically like the brain of a computer. It processes all the information on a computational level.

It takes information from the RAM and processes it to perform the tasks required from the computer.

It is usually seated in a socket that utilizes a lever or a latch with a hinged plate with a cut out in the center to secure it onto the motherboard.

It has many copper pads underneath it for the contacts of the socket to push up against them to make electrical contact.

There are other ways CPU’s can be attached to the motherboard.

Here are some common examples:

  • ZIF (Zero Insertion Force): Although this a more desirable socket, they are mostly found on older computer motherboards. A lever-operated a mechanism to clamp the pins of the processor.
  • PGA (Pin Grid Array): It is also a ZIF socket but has a different pin pitch and contains a different pin count.
  • LGA (Land Grid Array): More commonly found on motherboards today. A levered hinged plate with a center cut out clamps down on the processor.
  • BGA (Ball Grid Array): The CPU is soldered directly onto the motherboard. This makes it a non-user swappable part. It is susceptible to bad connectivity.

A processor generates a decent amount of heat, especially when it is working under high loads.

It will run even hotter when it is set to a higher clock speed in order to make it run faster. This is called overclocking.

This is why a heatsink and fan assembly is required in order to draw the heat away from the processor and distribute it to thin sheets or fins of metal for the fan to cool down.

There are so many different types of processors. The top manufacturers for computers are Intel, AMD, and NVidia.

4. RAM: Random Access Memory


RAM is a data storage device that can provide fast read and write access. RAM is also volatile which means that it loses all the stored data the moment power is lost.

The RAM keeps data ready for the CPU to process. The speed of the RAM is a big contributor to the overall speed of a computer.

It plugs directly into a long slot which has contacts on either side of the slot.

It too has a clock speed, just like a processor. So, it can also be overclocked to deliver increased performance beyond the intended specification.

Certain RAM modules are sold with a heat spreader. It helps dissipate the heat from the individual memory IC’s, keeping them cooler.

RAM has evolved like any other component. RAM used on the motherboard often makes use of DDR (Double Data Rate) SDRAM (Synchronous Dynamic Random Access Memory) type memory.

5. Graphics Card

graphics card processes the data from the motherboard and sends the appropriate information to the monitor in order for it to be displayed.

It can do so using an HDMI, DisplayPort, DVI, or VGA connector.

A graphics card can also be referred to as a video card or a display card.

It takes the burden of all the video processing from the main CPU. This gives a computer a big boost in performance.

Because of the large processing requirements for a gaming graphics cardfans are almost a given.

A graphics card plugs into a PCI Express (Peripheral Component Interconnect Express) slot on the motherboard. It is a serial expansion bus slot that is capable of a high amount of bandwidth, in two directions.

A graphics card has a GPU (Graphics Processing Unit) which is the main component that requires cooling.

A GPU is slower than a CPU, but it is designed to deal with mathematical operations required for video rendering.

The amount of memory on the card varies depending on the manufacturer’s design.

Graphics cards use GDDR (Graphics Double Data Rate) SDRAM which is specially designed to be optimized for graphics performance.

GDDR is built to handle a higher bandwidth compared to plain DDR ram.

6. Sound Card

Most of the time the sound chip built into the motherboard is used for audio output.

But, if you are a sound enthusiast or prefer higher detailed audio while playing a game, you might be inclined to use a sound card.

Sound cards plug into a computer in multiple ways. It can be through USB, PCI slot, or PCI Express x 1 slot.

A sound processing chip on the card does all of the audio processing and is usually not a very powerful processor.

A sound card can offer a wide range of connectivity with various audio equipment.

A few examples could be optical audio, 1/4 inch jack, or RCA connectors.

7. Hard Drive

A hard drive is found in most computers. It’s usually a mechanical drive that stores all the data.

Apart from storing data, it can also be used as a boot drive in order to run the operating system from it.

An operating system is a software program that makes a computer useable. Like Microsoft Windows for example.

The biggest vulnerability of a mechanical drive is the physically fragile nature of it.

One bump the wrong way can destroy a whole drive.

A mechanical hard drive contains one or more platters that spin anywhere between 5200 to 10000 RPM (revolutions per minute). The read and write heads are spaced only about 0.002 (51 micro M) of an inch away from the platter.

This gives you an idea about the physical limitations regarding its fragile nature.

Small areas on the platter can be arranged to represent a 1 or a 0. It can be changed using the drive head to magnetically alter the material to represent the correct value.

8. SSD: Solid State Drive

An SSD is also a type of hard drive, but it doesn’t have any moving parts. It consists of a bank of flash memory that can hold a reasonable amount of data.

While SSD’s are increasing in size all the time, they aren’t cost-effective for storing large amounts of data.

A mechanical drive has a cheaper gigabyte to dollar ratio.

However, the SSD is a high-performance drive. It’s fast and cannot be as easily damaged by dropping it or taking a few knocks.

That’s why I always recommend SSD’s for portable type computers where possible. 

9. PSU: Power Supply Unit

A power supply mounts inside the computer case. This converts the AC mains supply from the wall socket and supplies the correct DC voltages to all the components inside the computer.

A computer power supply supplies the following voltages:

  • +3.3v: This voltage is supplied to the motherboard.
  • +5V: This voltage is supplied to the motherboard and other internal components.
  • +12V: This voltage is supplied to the motherboard and other internal components.
  • -12V: This voltage is supplied to the motherboard.

You get different wattage ratings for power supplies. The higher the wattage, the higher the amount of electrical current can be made available to parts that need it.

The higher you go in Watts, the more the power supply will be likely to cost.

A power supply also comes with its own cooling fan. This helps all the internal components to stay cool when the power supply is subjected to bigger loads.


10. Monitor



monitor is what you use to see a visual representation of the graphics data sent from the graphics card of the computer.

There are various types of monitors on the market. The most commonly used is a LED-backlit LCD monitor.

There are also a variety of different sizes with different aspect ratios. The aspect ratio is simply the ratio between height and width.

For example, a 16:9 aspect ratio monitor will have 16 parts wide to 9 parts in height.

There are also curved monitors, but they are more expensive.

Monitors also have a fast response time in order to keep up with the high demands required to eliminate delays with user input for gaming.

11. Keyboard




A keyboard is one of the ways to communicate with a computer. By typing a key from the keyboard, it sends a small portion of data to tell the computer which key was pressed.

The computer can use this information in many ways. An example could be a command or a character that can be used in a document.


12. Mouse

A mouse allows the user to move a pointer displayed on the monitor and experience a more intuitive interaction with the computer.

These days mice have more buttons than the common three.

The three main buttons, however, allows the user to select, grab, scroll and access extra menus and options.

A computer mouse can be wired or wireless. The latter obviously requires batteries.

You can take a look at my favorite mouse right here.

Optical mice of today allow for very accurate precision and smooth movement.

Common external peripherals

Here are some common peripherals that get connected to a computer and extends its usefulness.

Printer

A printer can take an image sent by a computer and deliver it onto a sheet of paper.

It does this by using the data from the computer and by either using toner or ink, it deposits one of these in a controlled and accurate manner to form the image.

Scanner


A scanner can take anything on a piece of paper and scan it to produce a replicated digital image.

This is also very handy for saving physical photos that you want to preserve.

Once the photo is stored digitally, it won’t decay as a physical photo does over time.

Computer Speakers

Computer speakers can connect up to the sound card at the rear of the computer.

Another way they can be connected is by a monitor that already has built-in speakers.

Generally, the sound quality is poor from a monitor’ speakers. That’s why most people buy a set of computer speakers to have on their computer desk.

You can even connect up a 7.1 surround speaker system to certain sound cards.

This can add a nicer experience when it comes to gaming, playing music, or watching a film.


=======================================================

COMPUTER INSIDE OPERATIONS

How to create a Folder in your System?

1)Go to windows explorer by clicking folder icon in status bar
2)click on This Pc in left hand panel
3)Select the folder(like Desktop or downloads or documents or pictures or drive(C or D or E) and click on that folder or drive
4)rightclick on the right panel-->choose new in the panel-->click on folder option
5)provide a name for folder--press ENTER key from keyboard

\ --backward slash
/--forward slash
: --colon
; --semicolon
> --greater than
< --less than
? --questions

Brackets:
[] --square brackets
{} --curly brackets(press shift 
() --paranthesis(press shift 9 and 0)

_ --->underscore

How to Create file -text file 


rightclick in any folder inside-->new -->click on textdocument option
provide a name for the file.
what is the extension of text file?
.txt
filename.txt

How to open the file?
mouseover on the file
rightclick on the file
then choose the option--open

How to Create a microsfot word document?

rightclick in any folder inside-->new -->click on Microsfot office word document
then provide a file name.
What is the extension of microsoft word document?
.docx

How to Create an excelsheet in particular folder.?

navigate to the folder
rightclick in the folder-->new -->microsoft office excel worksheet
provide a name for excel sheet.
what is the extension of excel sheet?
.xlsx

How to Create a image file?
right click in any folder inside-->new -->click on bitmap image.
Then provide a name.

what are different image file extensions?
.png
           .jpeg or jpg
.bmp
.gif

how to create image file with microsoft paint?
in the windows search bar type the paint
double click on paint app ==then paint window will open to you.

how to save this paint file in particular folder?

Opening Paint -->Search paint from windows search bar at bottom left side-->Then type paint in search --click on paint app-->then draw something inside paint using tools
Click on file menu on top left side
click on save as 
go to the folder where you want to save like c:\Test
provide the filename in filename editbox
select save as type --either gif or jpeg or png
click on Save button



How to Download Files from Websites?

i)Open any browser(Google Chrome, firefox,Microsoft Edge or internetExplorer and Safari etc..)
ii)Type the website url in browser address bar
iii)Press ENTER key from keyboard
iv)choose the file to download-->click on download link
v)File will download to downloads folder

How to Move downloaded file to particular folder?

1)Go to the Downloads folder
2)select the file
3)right click on the file
4)choose cut option or Ctrl + x
5)go to the folder where you want to paste the file(if folder is not there create new folder)
6)right click on the folder
7)choose paste or Ctrl + v

How to UNZIP the ZIP File?

PreCondition: You should have ZIP file in your folder
i)Right Click on the Zipped Compressed file
ii)choose extract All option
iii)click on extract button
iv)Another file Folder will be created  with same zipped file name

How to Install Software in your System/laptop?

1)Download NotePad++ software
ii)Open the google.com in the browser
iii)type the notepad++ in search editbox
iv)press ENTER key from keyboard
v)Go to right website
vi)Choose the right version of the software
vii)Click on Downloads
viii)filename.exe is downloaded
ix)go to the downloads folder
x)double click on software application(.exe)
xi)open the windows application
xii)proceed the with installation

How to Uninstall Software in your System/laptop?

1)Type Control panel in bottom left side search bar -->Go to Control Panel
2)Click on Programs
3)click on Programs and Features
4)Select the software which you want to uninstall
5)Click on Uninstall
6)Do you want to uninstall completely-->click yes button
7)Proceed with uninstall process