Jump to content
منتدى البحرين اليوم

اسايمنت 6 cs101 ؟؟؟


Recommended Posts

هاي....

شخباركم بنات و شباب؟ عساكم بخير و صحة و سلامة؟

 

ابي اسأل اذا احد حل اسايمنت 6 حق ال ITCS 101 .....؟

 

حل هذا الاسايمنت يتعلق بحل الاسايمنت اللي قبله ( اسايمنت 5 ) .......والسؤال يقول:

 

Write a program that prompts the user to enter the name of an item, searches the file invoice.txt that was created in Assignment 5 for the item, and then displays the name and the price associated with that item. If the search item isn't in the list, you reach the end of file.

Use a compound flag-controlled while loop to search the list until either the item is found or the end of file is reached. Display a message if the item isn't found.

 

Depending on the data entered. The input entered by the user is shown in bold:

 

 

Enter name of item for search: shovel

The item shovel costs 35.40

Or

Enter name of item for search: hoe

The item hoe was not found

 

 

اذا أحد عرف يحله قبل يوم الأحد .... باكون له شااااااااكرة

merci مقدماً

Link to comment
Share on other sites

السلاااااااااااااااااام

 

 

 

 

ههههههههههههههه

 

طبعا انه ابيه بعد

 

 

مشكورة لانج هالمرة نزلتيه قبلي

 

 

 

شاكرين لكم تقديمكم المساعدة مقدما

 

وانه حالي من حالها ابيه بعد حق يوم الاحد

 

 

 

تحيااااااااااااتي

Link to comment
Share on other sites

السلاااااااااااااااااااااام

 

بو للحين محد نزله

 

 

انه حليته وخلصت

 

 

وانتي حنينو اشتنطرين واتنزلينه ياماما

 

 

انه باحطه

 

 

 

#include<iostream>

#include<fstream>

#include<string>

#include<iomanip>

using namespace std;

void main()

{

string name,stuff;

char ch;

double cost;

 

ifstream infile;

 

 

infile.open("invoicel.txt");

cout<<"Enter name of item for search: ";

cin>>name;

infile.ignore(100,'\n');

infile.ignore(100,'\n');

getline(infile,stuff,'#');

 

while(infile)

{

 

infile>>cost;

 

if(name==stuff)

{

 

 

cout<<"The item "<<stuff<<" costs"<<" "<<cost<<endl;

break;

}

 

infile.get(ch);

getline(infile,stuff,'#');

 

 

}//while

 

if ((name!=stuff))

cout<<"The item"<<" "<<name<<" "<<"was not found"<<endl;

 

 

infile.close();

}

 

 

وللأمانة انه ناقله الحل من شخص وادعو له

 

وبانزل لكم اسايمنت 7 اذا تبون الحل ماله

 

 

 

تحيااااتي

 

 

Link to comment
Share on other sites

السلاااااااااااااااااام

 

انشااااااالله حبوية عيون الريم من عيوووووووني

 

بس اكيد ييت متاخرة

 

 

 

المهم باحطه على كل حال

 

 

 

تفضلــــــــــــــــــــو

 

 

 

 

 

#include<iostream>

using namespace std;

void main()

{

int x,y;

cout<<" A\t B\t C\t D\t E"<<endl;

cout<<endl;

for(x=1;x<=5;x++)

cout<<x<<"\t"; l

{

 

for(y=1;y<=5;y++)

cout<<" "<<y*x<<"\t";

cout<<endl;

}

}

 

 

طبعا ناقلتــه وادعو للي حله

 

 

تحيااااااااااااتي

 

 

Link to comment
Share on other sites

اختي شايمة الجامعة الحل المنقول الى اسايمنت 7 غير صحيح

 

 

الحل الصحيح الى اسايمنت 7 هو

 

#include<iostream>

 

using namespace std;

void main()

{

int x,y,s;

 

cout<<"\tA\tB\tC\tD\tE"<<endl;

 

for(x=1;x<=5;x++)

 

{

 

s=x;

cout<<s;

 

for(y=1;y<=5;y++)

 

cout<<"\t"<<x*y<<" ";

 

cout<<endl;

 

}//while

 

}//main

 

 

ادعوا الي بالتوفيق

تحياتي

طالبةIT

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
الرد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...